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)Create a config override value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToSystemProperties()voidremoveFromSystemProperties()voidresolveValue(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.voidsetPrefix(java.lang.String prefix)
-
-
-
Constructor Detail
-
ConfigOverrideExtensionValue
public ConfigOverrideExtensionValue(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.String storageKey, java.lang.String configPath)Create a config override value.- Parameters:
namespace- namespacestorageKey- storage keyconfigPath- config yaml path
-
-
Method Detail
-
setPrefix
public void setPrefix(java.lang.String prefix)
- 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
-
-