Class ConfigOverrideExtensionValue
java.lang.Object
io.dropwizard.testing.ConfigOverride
ru.vyarus.dropwizard.guice.test.util.ConfigOverrideExtensionValue
- All Implemented Interfaces:
ConfigurablePrefix
public class ConfigOverrideExtensionValue
extends io.dropwizard.testing.ConfigOverride
implements ConfigurablePrefix
Config override implementation for values computed in 3rd party junit 5 extensions. Such extension must put
value into junit storage (preferably, with key equal to overriding property path). This value would be resolved
under junit "before all" phase, just before dropwizard test support object creation (and so 3rd party extension
MUST be executed before guicey extension).
- Since:
- 10.05.2022
-
Constructor Summary
ConstructorsConstructorDescriptionConfigOverrideExtensionValue(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, String storageKey, String configPath) Create a config override value. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidresolveValue(org.junit.jupiter.api.extension.ExtensionContext context) Called to resolve actual value from configured namespace. 3rd party extension must already initialize value in the store.voidMethods inherited from class io.dropwizard.testing.ConfigOverride
config, config, config, config, randomPorts, randomPorts
-
Constructor Details
-
Method Details
-
setPrefix
- Specified by:
setPrefixin interfaceConfigurablePrefix- Parameters:
prefix- current test's prefix
-
resolveValue
public void resolveValue(org.junit.jupiter.api.extension.ExtensionContext context) Called to resolve actual value from configured namespace. 3rd party extension must already initialize value in the store.- Parameters:
context- test context
-
addToSystemProperties
public void addToSystemProperties()- Specified by:
addToSystemPropertiesin classio.dropwizard.testing.ConfigOverride
-
removeFromSystemProperties
public void removeFromSystemProperties()- Specified by:
removeFromSystemPropertiesin classio.dropwizard.testing.ConfigOverride
-