diff --git a/src/main/java/com/switcherapi/client/model/SwitcherBuilder.java b/src/main/java/com/switcherapi/client/model/SwitcherBuilder.java index 0e17344..70d325f 100644 --- a/src/main/java/com/switcherapi/client/model/SwitcherBuilder.java +++ b/src/main/java/com/switcherapi/client/model/SwitcherBuilder.java @@ -4,9 +4,7 @@ import com.switcherapi.client.exception.SwitcherContextException; import org.apache.commons.lang3.StringUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * Builder class that simplifies how input are programmatically wrapped inside the Switcher. @@ -17,6 +15,8 @@ public abstract class SwitcherBuilder implements Switcher { protected final SwitcherProperties properties; + + protected final Map, SwitcherResult> historyExecution; protected long delay; @@ -32,16 +32,18 @@ public abstract class SwitcherBuilder implements Switcher { protected SwitcherBuilder(final SwitcherProperties properties) { this.properties = properties; + this.historyExecution = new HashMap<>(); this.entry = new ArrayList<>(); this.delay = 0; } /** - * Clear all entries previously added + * Clear all entries previously added and history of executions. * * @return {@link SwitcherBuilder} */ public SwitcherBuilder flush() { + this.historyExecution.clear(); this.entry.clear(); return this; } diff --git a/src/main/java/com/switcherapi/client/model/SwitcherRequest.java b/src/main/java/com/switcherapi/client/model/SwitcherRequest.java index 8025488..b698970 100644 --- a/src/main/java/com/switcherapi/client/model/SwitcherRequest.java +++ b/src/main/java/com/switcherapi/client/model/SwitcherRequest.java @@ -23,8 +23,6 @@ public final class SwitcherRequest extends SwitcherBuilder { private final SwitcherExecutor switcherExecutor; private final String switcherKey; - - private final Map, SwitcherResult> historyExecution; private AsyncSwitcher asyncSwitcher; @@ -41,7 +39,6 @@ public SwitcherRequest(final String switcherKey, super(switcherProperties); this.switcherExecutor = switcherExecutor; this.switcherKey = switcherKey; - this.historyExecution = new HashMap<>(); } @Override diff --git a/src/test/java/com/switcherapi/client/SwitcherBasicCriteriaResponseTest.java b/src/test/java/com/switcherapi/client/SwitcherBasicCriteriaResponseTest.java index 8e6e600..b71f862 100644 --- a/src/test/java/com/switcherapi/client/SwitcherBasicCriteriaResponseTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherBasicCriteriaResponseTest.java @@ -15,6 +15,7 @@ import java.io.IOException; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherBasicCriteriaResponseTest extends MockWebServerHelper { @@ -31,7 +32,7 @@ static void setup() throws IOException { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherBasicTest.java b/src/test/java/com/switcherapi/client/SwitcherBasicTest.java index e73db94..ec6dba0 100644 --- a/src/test/java/com/switcherapi/client/SwitcherBasicTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherBasicTest.java @@ -11,6 +11,7 @@ import java.io.IOException; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -28,7 +29,7 @@ static void setup() throws IOException { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherContextBuilderTest.java b/src/test/java/com/switcherapi/client/SwitcherContextBuilderTest.java index c7a46f1..dc5f2bb 100644 --- a/src/test/java/com/switcherapi/client/SwitcherContextBuilderTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherContextBuilderTest.java @@ -11,6 +11,7 @@ import static com.switcherapi.SwitchersBase.*; import static com.switcherapi.client.SwitcherContextValidator.ERR_LOCAL; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherContextBuilderTest { @@ -26,7 +27,7 @@ void shouldReturnSuccess() { .apiKey("API_KEY") .domain("switcher-domain") .component("switcher-client") - .environment("default") + .environment(DEFAULT_ENV) .snapshotLocation(SNAPSHOTS_LOCAL) .local(true)); @@ -46,7 +47,7 @@ void shouldReturnError_snapshotNotLoaded() { .apiKey("API_KEY") .domain("switcher-domain") .component("switcher-client") - .environment("default") + .environment(DEFAULT_ENV) .snapshotLocation(null) .local(true)); diff --git a/src/test/java/com/switcherapi/client/SwitcherContextRemoteExecutorTest.java b/src/test/java/com/switcherapi/client/SwitcherContextRemoteExecutorTest.java index 32c46e9..504b22e 100644 --- a/src/test/java/com/switcherapi/client/SwitcherContextRemoteExecutorTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherContextRemoteExecutorTest.java @@ -11,6 +11,7 @@ import java.io.IOException; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherContextRemoteExecutorTest extends MockWebServerHelper { @@ -40,7 +41,7 @@ void shouldConfigureRemotePoolSize() { .apiKey("API_KEY") .domain("switcher-domain") .component("switcher-client-pool-test") - .environment("default") + .environment(DEFAULT_ENV) .poolConnectionSize(1) .local(false)); @@ -66,7 +67,7 @@ void shouldConfigureRemoteTimeout() { .apiKey("API_KEY") .domain("switcher-domain") .component("switcher-client-timeout-test") - .environment("default") + .environment(DEFAULT_ENV) .timeoutMs(500) .local(false)); diff --git a/src/test/java/com/switcherapi/client/SwitcherFail1Test.java b/src/test/java/com/switcherapi/client/SwitcherFail1Test.java index 639b9a2..77e2a37 100644 --- a/src/test/java/com/switcherapi/client/SwitcherFail1Test.java +++ b/src/test/java/com/switcherapi/client/SwitcherFail1Test.java @@ -14,6 +14,7 @@ import java.io.IOException; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherFail1Test extends MockWebServerHelper { @@ -43,7 +44,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherFail2Test.java b/src/test/java/com/switcherapi/client/SwitcherFail2Test.java index e85123a..f8cbe96 100644 --- a/src/test/java/com/switcherapi/client/SwitcherFail2Test.java +++ b/src/test/java/com/switcherapi/client/SwitcherFail2Test.java @@ -13,6 +13,7 @@ import java.io.IOException; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -40,7 +41,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherSilentModeTest.java b/src/test/java/com/switcherapi/client/SwitcherSilentModeTest.java index e1bd267..1b7d2a1 100644 --- a/src/test/java/com/switcherapi/client/SwitcherSilentModeTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherSilentModeTest.java @@ -14,6 +14,7 @@ import java.io.IOException; import java.nio.file.Paths; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.assertTrue; class SwitcherSilentModeTest extends MockWebServerHelper { @@ -41,7 +42,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherSnapshotLookupTest.java b/src/test/java/com/switcherapi/client/SwitcherSnapshotLookupTest.java index 45aa5aa..07241d4 100644 --- a/src/test/java/com/switcherapi/client/SwitcherSnapshotLookupTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherSnapshotLookupTest.java @@ -14,6 +14,7 @@ import java.nio.file.Files; import java.nio.file.Paths; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -52,7 +53,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationFailTest.java b/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationFailTest.java index 6fdd407..42e6b8c 100644 --- a/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationFailTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationFailTest.java @@ -12,6 +12,7 @@ import java.nio.file.Files; import java.nio.file.Paths; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -46,7 +47,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationTest.java b/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationTest.java index 10c9fd7..5900e94 100644 --- a/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherSnapshotValidationTest.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.nio.file.Paths; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherSnapshotValidationTest extends MockWebServerHelper { @@ -43,7 +44,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); @@ -105,7 +106,7 @@ void shouldValidateAndLoadSnapshot_whenLocal() { .local(true) .snapshotAutoLoad(false) .snapshotLocation(RESOURCES_PATH) - .environment("default")); + .environment(DEFAULT_ENV)); Switchers.initializeClient(); @@ -129,7 +130,7 @@ void shouldNotValidateAndLoadSnapshot_serviceUnavailable() { .local(false) .snapshotAutoLoad(false) .snapshotLocation(RESOURCES_PATH) - .environment("default")); + .environment(DEFAULT_ENV)); Switchers.initializeClient(); diff --git a/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java b/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java new file mode 100644 index 0000000..faecf2f --- /dev/null +++ b/src/test/java/com/switcherapi/client/SwitcherThrottle1Test.java @@ -0,0 +1,64 @@ +package com.switcherapi.client; + +import com.switcherapi.SwitchersBase; +import com.switcherapi.client.model.Switcher; +import com.switcherapi.fixture.CountDownHelper; +import com.switcherapi.fixture.MockWebServerHelper; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class SwitcherThrottle1Test extends MockWebServerHelper { + + @BeforeAll + static void setup() throws IOException { + MockWebServerHelper.setupMockServer(); + + SwitchersBase.configure(ContextBuilder.builder(true) + .context(SwitchersBase.class.getName()) + .url(String.format("http://localhost:%s", mockBackEnd.getPort())) + .apiKey("TEST_API_KEY") + .domain("TEST_DOMAIN") + .component("TEST_COMPONENT") + .environment(DEFAULT_ENV)); + + SwitchersBase.initializeClient(); + } + + @AfterAll + static void tearDown() { + MockWebServerHelper.tearDownMockServer(); + } + + @Test + void shouldReturnTrue_withThrottle() { + // Initial remote call + givenResponse(generateMockAuth(10)); //auth + givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached) + + // Throttle period - should use cache + givenResponse(generateCriteriaResponse("false", false)); //criteria - async (background) + givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background) + + //test + Switcher switcher = SwitchersBase + .getSwitcher(SwitchersBase.USECASE11) + .flush() + .checkValue("value") + .throttle(1000); + + for (int i = 0; i < 100; i++) { + assertTrue(switcher.isItOn()); + } + + CountDownHelper.wait(1); + assertFalse(switcher.isItOn()); + } + +} diff --git a/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java b/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java new file mode 100644 index 0000000..5cc29ca --- /dev/null +++ b/src/test/java/com/switcherapi/client/SwitcherThrottle2Test.java @@ -0,0 +1,61 @@ +package com.switcherapi.client; + +import com.switcherapi.SwitchersBase; +import com.switcherapi.client.model.SwitcherBuilder; +import com.switcherapi.fixture.MockWebServerHelper; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class SwitcherThrottle2Test extends MockWebServerHelper { + + @BeforeAll + static void setup() throws IOException { + MockWebServerHelper.setupMockServer(); + + SwitchersBase.configure(ContextBuilder.builder(true) + .context(SwitchersBase.class.getName()) + .url(String.format("http://localhost:%s", mockBackEnd.getPort())) + .apiKey("TEST_API_KEY") + .domain("TEST_DOMAIN") + .component("TEST_COMPONENT") + .environment(DEFAULT_ENV)); + + SwitchersBase.initializeClient(); + } + + @AfterAll + static void tearDown() { + MockWebServerHelper.tearDownMockServer(); + } + + @Test + void shouldRetrieveNewResponse_whenStrategyInputChanged() { + // Initial remote call + givenResponse(generateMockAuth(10)); //auth + givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached) + givenResponse(generateCriteriaResponse("false", false)); //criteria - async (cached) + + // Throttle period - should use cache + givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background) + + //test + SwitcherBuilder switcher = SwitchersBase + .getSwitcher(SwitchersBase.USECASE11) + .flush() + .throttle(1000); + + for (int i = 0; i < 100; i++) { + assertTrue(switcher.checkValue("value").isItOn()); + } + + assertFalse(switcher.checkValue("value_changed").isItOn()); + } + +} diff --git a/src/test/java/com/switcherapi/client/SwitcherThrottleTest.java b/src/test/java/com/switcherapi/client/SwitcherThrottleTest.java deleted file mode 100644 index f10ce77..0000000 --- a/src/test/java/com/switcherapi/client/SwitcherThrottleTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.switcherapi.client; - -import com.switcherapi.Switchers; -import com.switcherapi.client.model.Switcher; -import com.switcherapi.client.model.SwitcherBuilder; -import com.switcherapi.fixture.CountDownHelper; -import com.switcherapi.fixture.MockWebServerHelper; -import mockwebserver3.QueueDispatcher; -import org.junit.jupiter.api.*; - -import java.io.IOException; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class SwitcherThrottleTest extends MockWebServerHelper { - - @BeforeAll - static void setup() throws IOException { - MockWebServerHelper.setupMockServer(); - - Switchers.loadProperties(); - Switchers.configure(ContextBuilder.builder().url(String.format("http://localhost:%s", mockBackEnd.getPort()))); - } - - @AfterAll - static void tearDown() { - MockWebServerHelper.tearDownMockServer(); - } - - @BeforeEach - void resetSwitcherContextState() { - ((QueueDispatcher) mockBackEnd.getDispatcher()).clear(); - - Switchers.configure(ContextBuilder.builder() - .local(false) - .snapshotLocation(null) - .snapshotSkipValidation(false) - .environment("default") - .silentMode(null) - .snapshotAutoLoad(false) - .snapshotAutoUpdateInterval(null)); - } - - @Test - @Order(1) - void shouldReturnTrue_withThrottle() { - Switchers.initializeClient(); - - // Initial remote call - givenResponse(generateMockAuth(10)); //auth - givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached) - - // Throttle period - should use cache - givenResponse(generateCriteriaResponse("false", false)); //criteria - async (background) - givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background) - - //test - Switcher switcher = Switchers - .getSwitcher(Switchers.REMOTE_KEY) - .checkValue("value") - .throttle(1000); - - for (int i = 0; i < 100; i++) { - assertTrue(switcher.isItOn()); - } - - CountDownHelper.wait(1); - assertFalse(switcher.isItOn()); - } - - @Test - @Order(2) - void shouldRetrieveNewResponse_whenStrategyInputChanged() { - Switchers.initializeClient(); - - // Initial remote call - givenResponse(generateMockAuth(10)); //auth - givenResponse(generateCriteriaResponse("true", false)); //criteria - sync (cached) - givenResponse(generateCriteriaResponse("false", false)); //criteria - async (cached) - - // Throttle period - should use cache - givenResponse(generateCriteriaResponse("false", false)); //criteria - async after 1 sec (background) - - //test - SwitcherBuilder switcher = Switchers - .getSwitcher(Switchers.REMOTE_KEY) - .throttle(1000); - - for (int i = 0; i < 100; i++) { - assertTrue(switcher.checkValue("value").isItOn()); - } - - assertFalse(switcher.checkValue("value_changed").isItOn()); - } - -} diff --git a/src/test/java/com/switcherapi/client/SwitcherValidateTest.java b/src/test/java/com/switcherapi/client/SwitcherValidateTest.java index f227608..eac35c3 100644 --- a/src/test/java/com/switcherapi/client/SwitcherValidateTest.java +++ b/src/test/java/com/switcherapi/client/SwitcherValidateTest.java @@ -13,6 +13,7 @@ import java.util.HashSet; import java.util.Set; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static org.junit.jupiter.api.Assertions.*; class SwitcherValidateTest extends MockWebServerHelper { @@ -42,7 +43,7 @@ void resetSwitcherContextState() { .local(false) .snapshotLocation(null) .snapshotSkipValidation(false) - .environment("default") + .environment(DEFAULT_ENV) .silentMode(null) .snapshotAutoLoad(false) .snapshotAutoUpdateInterval(null)); diff --git a/src/test/java/com/switcherapi/client/service/local/SwitcherLocalServiceTest.java b/src/test/java/com/switcherapi/client/service/local/SwitcherLocalServiceTest.java index a6a55be..4fc8307 100644 --- a/src/test/java/com/switcherapi/client/service/local/SwitcherLocalServiceTest.java +++ b/src/test/java/com/switcherapi/client/service/local/SwitcherLocalServiceTest.java @@ -1,5 +1,6 @@ package com.switcherapi.client.service.local; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; import static com.switcherapi.client.remote.Constants.DEFAULT_TIMEOUT; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -39,7 +40,7 @@ static void init() { SwitchersBase.configure(ContextBuilder.builder() .context(SwitchersBase.class.getName()) .snapshotLocation(SNAPSHOTS_LOCAL) - .environment("default") + .environment(DEFAULT_ENV) .local(true)); SwitcherProperties properties = SwitchersBase.getSwitcherProperties(); diff --git a/src/test/java/com/switcherapi/client/utils/SnapshotWatcherWorkerTest.java b/src/test/java/com/switcherapi/client/utils/SnapshotWatcherWorkerTest.java index c17b40a..1d605ea 100644 --- a/src/test/java/com/switcherapi/client/utils/SnapshotWatcherWorkerTest.java +++ b/src/test/java/com/switcherapi/client/utils/SnapshotWatcherWorkerTest.java @@ -6,6 +6,8 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; + class SnapshotWatcherWorkerTest extends SnapshotTest { @BeforeAll @@ -13,7 +15,7 @@ static void setupContext() { SwitchersBase.configure(ContextBuilder.builder(true) .context(SwitchersBase.class.getName()) .snapshotLocation(SNAPSHOTS_LOCAL) - .environment("default") + .environment(DEFAULT_ENV) .local(true)); SwitchersBase.initializeClient(); diff --git a/src/test/java/com/switcherapi/client/utils/SwitcherUtilsTest.java b/src/test/java/com/switcherapi/client/utils/SwitcherUtilsTest.java index 7dfa42f..5a5540b 100644 --- a/src/test/java/com/switcherapi/client/utils/SwitcherUtilsTest.java +++ b/src/test/java/com/switcherapi/client/utils/SwitcherUtilsTest.java @@ -29,6 +29,8 @@ import com.switcherapi.client.exception.SwitcherSnapshotLoadException; import com.switcherapi.client.model.ContextKey; +import static com.switcherapi.client.remote.Constants.DEFAULT_ENV; + class SwitcherUtilsTest { private static final String SNAPSHOTS_LOCAL = Paths.get(StringUtils.EMPTY).toAbsolutePath() + "/src/test/resources"; @@ -121,7 +123,7 @@ void shouldReturnMillis(String time, long expectedValue) { */ static Stream envArguments() { return Stream.of( - Arguments.of("default", "default"), + Arguments.of(DEFAULT_ENV, DEFAULT_ENV), Arguments.of("${PORT:8080}", "8080"), Arguments.of("${SNAPSHOT_LOCAL:}", ""), Arguments.of("${ENVIRONMENT}", "staging")