Class KoraConfigString

java.lang.Object
ru.tinkoff.kora.test.extension.junit5.KoraConfigString
All Implemented Interfaces:
KoraConfigModification

public final class KoraConfigString extends Object implements KoraConfigModification
Configs inside KoraConfigString are merged in user specified method order

All configs specified for test are merged into single config, each next config replaces values from previous configs

  • Method Details

    • systemProperties

      @Nonnull public Map<String,String> systemProperties()
      Specified by:
      systemProperties in interface KoraConfigModification
    • withSystemProperty

      @Nonnull public KoraConfigString withSystemProperty(@Nonnull String key, @Nonnull String value)
      Description copied from interface: KoraConfigModification
      Example: Given config below
        myconfig {
         myinnerconfig {
           first = ${ENV_FIRST}
           second = ${ENV_SECOND}
         }
       }
       
      Use system property to set `ENV_FIRST` and 'ENV_SECOND' KoraConfigModification.ofString(""" myconfig { myinnerconfig { first = ${ENV_FIRST} second = ${ENV_SECOND} } } """) .withSystemProperty("ENV_FIRST", "1") .withSystemProperty("ENV_SECOND", "2");
      Specified by:
      withSystemProperty in interface KoraConfigModification
      Parameters:
      key - system property key
      value - system property value
      Returns:
      self
    • toString

      public String toString()
      Overrides:
      toString in class Object