diff --git a/src/main/java/no/finn/unleash/DefaultUnleash.java b/src/main/java/no/finn/unleash/DefaultUnleash.java index 30eba4f14..c93ac2f00 100644 --- a/src/main/java/no/finn/unleash/DefaultUnleash.java +++ b/src/main/java/no/finn/unleash/DefaultUnleash.java @@ -15,16 +15,7 @@ import no.finn.unleash.repository.HttpToggleFetcher; import no.finn.unleash.repository.ToggleBackupHandlerFile; import no.finn.unleash.repository.ToggleRepository; -import no.finn.unleash.strategy.ApplicationHostnameStrategy; -import no.finn.unleash.strategy.DefaultStrategy; -import no.finn.unleash.strategy.FlexibleRolloutStrategy; -import no.finn.unleash.strategy.GradualRolloutRandomStrategy; -import no.finn.unleash.strategy.GradualRolloutSessionIdStrategy; -import no.finn.unleash.strategy.GradualRolloutUserIdStrategy; -import no.finn.unleash.strategy.RemoteAddressStrategy; -import no.finn.unleash.strategy.Strategy; -import no.finn.unleash.strategy.UnknownStrategy; -import no.finn.unleash.strategy.UserWithIdStrategy; +import no.finn.unleash.strategy.*; import no.finn.unleash.util.UnleashConfig; import static java.util.Optional.ofNullable; @@ -50,6 +41,13 @@ public final class DefaultUnleash implements Unleash { private final EventDispatcher eventDispatcher; private final UnleashConfig config; + private static FeatureToggleRepository defaultToggleRepository(UnleashConfig unleashConfig) { + return new FeatureToggleRepository( + unleashConfig, + new HttpToggleFetcher(unleashConfig), + new ToggleBackupHandlerFile(unleashConfig) + ); + } public DefaultUnleash(UnleashConfig unleashConfig, Strategy... strategies) { this(unleashConfig, defaultToggleRepository(unleashConfig), strategies); @@ -65,14 +63,6 @@ public DefaultUnleash(UnleashConfig unleashConfig, ToggleRepository toggleReposi metricService.register(strategyMap.keySet()); } - private static FeatureToggleRepository defaultToggleRepository(UnleashConfig unleashConfig) { - return new FeatureToggleRepository( - unleashConfig, - new HttpToggleFetcher(unleashConfig), - new ToggleBackupHandlerFile(unleashConfig) - ); - } - @Override public boolean isEnabled(final String toggleName) { return isEnabled(toggleName, false);