Allow hierarchical Knot.x configuration usage in tests
Add config object for all mocks (KnotxMockConfig) - currently limited in functionality, but paves the way for loading mock config from Knot.x configuration
Potential breaking changes
See KnotxConfigConcatProcessor and KnotxExtension.createConfig(String[]). This fixes problems found in https://github.com/Knotx/knotx-stack/pull/19, but at the same time changes Knot.x configuration loading behavior. Configuration files will now be loaded into memory, overrides from KnotxWiremockExtension will be applied, and resulting configuration will be provided in-memory to KnotxStarterVerticle. This has a potential to omit some internal logic and assumptions, as found earlier in https://github.com/Cognifide/knotx/pull/440.
Instances of WireMockServer are now recognized by their mock name (be it a field name or parameter name), and as such these names currently have to be unique across all tests. So if two tests use the same mock named mockRepository and run simultaneously, then the mock instance will be reused for both tests, regardless of possible configuration differences between test mocks. Good examples are integration tests in https://github.com/Knotx/knotx-stack/pull/19.
KnotxMockConfig
) - currently limited in functionality, but paves the way for loading mock config from Knot.x configurationPotential breaking changes
KnotxConfigConcatProcessor
andKnotxExtension.createConfig(String[])
. This fixes problems found in https://github.com/Knotx/knotx-stack/pull/19, but at the same time changes Knot.x configuration loading behavior. Configuration files will now be loaded into memory, overrides fromKnotxWiremockExtension
will be applied, and resulting configuration will be provided in-memory toKnotxStarterVerticle
. This has a potential to omit some internal logic and assumptions, as found earlier in https://github.com/Cognifide/knotx/pull/440.Instances of WireMockServer are now recognized by their mock name (be it a field name or parameter name), and as such these names currently have to be unique across all tests. So if two tests use the same mock namedmockRepository
and run simultaneously, then the mock instance will be reused for both tests, regardless of possible configuration differences between test mocks. Good examples are integration tests in https://github.com/Knotx/knotx-stack/pull/19.