Class UnitTestFeatureToggler

java.lang.Object
org.junit.rules.ExternalResource
de.hybris.platform.integrationservices.util.featuretoggle.UnitTestFeatureToggler
All Implemented Interfaces:
org.junit.rules.TestRule

public class UnitTestFeatureToggler extends org.junit.rules.ExternalResource
A test rule that stubs feature toggle values. This rule should be used with unit tests.
  • Constructor Details

    • UnitTestFeatureToggler

      public UnitTestFeatureToggler(Feature feature)
      Initialize the test toggler.
      Parameters:
      feature - the Feature for which a test toggler is required
  • Method Details

    • isEnabled

      public boolean isEnabled()
      To check if the feature is enabled for which this toggler is initialized.
      Returns:
      true if feature is enabled, else false.
    • enable

      public UnitTestFeatureToggler enable()
      Enables the feature for which this toggler is initialized.
      Returns:
      this TestFeatureToggler instance
    • disable

      public UnitTestFeatureToggler disable()
      Disables the feature for which this toggler is initialized.
      Returns:
      this TestFeatureToggler instance
    • before

      protected void before()
      Overrides:
      before in class org.junit.rules.ExternalResource
    • after

      protected void after()
      Overrides:
      after in class org.junit.rules.ExternalResource