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
Constructors Constructor Description ConfigOverrideExtensionValue(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.String storageKey, java.lang.String configPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToSystemProperties()
void
removeFromSystemProperties()
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.void
setPrefix(java.lang.String prefix)
-
-
-
Method Detail
-
setPrefix
public void setPrefix(java.lang.String prefix)
- Specified by:
setPrefix
in 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:
addToSystemProperties
in classio.dropwizard.testing.ConfigOverride
-
removeFromSystemProperties
public void removeFromSystemProperties()
- Specified by:
removeFromSystemProperties
in classio.dropwizard.testing.ConfigOverride
-
-