Package io.getunleash
Class FakeUnleash
java.lang.Object
io.getunleash.FakeUnleash
- All Implemented Interfaces:
Unleash
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconditionallyEnable(Predicate<UnleashContext> contextMatcher, String... features) Enables or disables feature toggles depending on the evaluation of thecontextMatcher.voidvoidvoiddisableAllExcept(String... excludedFeatures) voidvoidvoidenableAllExcept(String... excludedFeatures) getVariant(String toggleName) getVariant(String toggleName, UnleashContext context) getVariant(String toggleName, UnleashContext context, Variant defaultValue) getVariant(String toggleName, Variant defaultValue) booleanisEnabled(String toggleName, UnleashContext context, BiPredicate<String, UnleashContext> fallbackAction) more()voidvoidresetAll()voidsetVariant(String toggleName, Variant variant)
-
Constructor Details
-
FakeUnleash
public FakeUnleash() -
FakeUnleash
-
-
Method Details
-
isEnabled
public boolean isEnabled(String toggleName, UnleashContext context, BiPredicate<String, UnleashContext> fallbackAction) -
getVariant
- Specified by:
getVariantin interfaceUnleash
-
getVariant
- Specified by:
getVariantin interfaceUnleash
-
getVariant
- Specified by:
getVariantin interfaceUnleash
-
getVariant
- Specified by:
getVariantin interfaceUnleash
-
more
-
getImpactMetrics
- Specified by:
getImpactMetricsin interfaceUnleash
-
enableAll
public void enableAll() -
enableAllExcept
-
disableAll
public void disableAll() -
disableAllExcept
-
resetAll
public void resetAll() -
enable
-
disable
-
reset
-
conditionallyEnable
Enables or disables feature toggles depending on the evaluation of thecontextMatcher. This can be called multiple times. If any of the context matchers match, the feature is enabled. This lets you conditionally configure multiple different tests to do different things, while running concurrently.This will be overwritten if
enable(String...)ordisable(String...)are called and vice versa.- Parameters:
contextMatcher- the context matcher to evaluatefeatures- the features for which the context matcher will be invoked
-
setVariant
-