Class 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)  
      • Methods inherited from class io.dropwizard.testing.ConfigOverride

        config, config, config, config, randomPorts, randomPorts
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigOverrideExtensionValue

        public ConfigOverrideExtensionValue​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                                            java.lang.String storageKey,
                                            java.lang.String configPath)
    • Method Detail

      • setPrefix

        public void setPrefix​(java.lang.String prefix)
        Specified by:
        setPrefix in interface ConfigurablePrefix
        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 class io.dropwizard.testing.ConfigOverride
      • removeFromSystemProperties

        public void removeFromSystemProperties()
        Specified by:
        removeFromSystemProperties in class io.dropwizard.testing.ConfigOverride