Class ConfigOverrideValue

java.lang.Object
io.dropwizard.testing.ConfigOverride
ru.vyarus.dropwizard.guice.test.util.ConfigOverrideValue
All Implemented Interfaces:
ConfigurablePrefix

public class ConfigOverrideValue extends io.dropwizard.testing.ConfigOverride implements ConfigurablePrefix
Class is a copy of ConfigOverrideValue, but with configurable prefix. This is required for junit 5 extensions because prefix is auto-generated for each test. Must be used with TestGuiceyAppExtension or TestDropwizardAppExtension.
Since:
06.03.2021
  • Constructor Details

    • ConfigOverrideValue

      public ConfigOverrideValue(String key, Supplier<String> value)
      Create a config override value.
      Parameters:
      key - config yaml path
      value - value
  • Method Details

    • setPrefix

      public void setPrefix(String prefix)
      Specified by:
      setPrefix in interface ConfigurablePrefix
      Parameters:
      prefix - current test's prefix
    • 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