From 47cff5b06dd10003088387b241e032d9d881e640 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Mon, 23 Oct 2023 11:36:16 -0300 Subject: [PATCH] Improve test cases --- .../split/client/SplitClientConfigTest.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/client/src/test/java/io/split/client/SplitClientConfigTest.java b/client/src/test/java/io/split/client/SplitClientConfigTest.java index 8115609d8..96f181301 100644 --- a/client/src/test/java/io/split/client/SplitClientConfigTest.java +++ b/client/src/test/java/io/split/client/SplitClientConfigTest.java @@ -78,9 +78,10 @@ public void testImpressionRefreshRateConstraints() { @Test public void setImpressionRefreshRateWorks() { - SplitClientConfig.builder() - .impressionsRefreshRate(1) + SplitClientConfig config = SplitClientConfig.builder() + .impressionsRefreshRate(65) .build(); + Assert.assertEquals(65, config.impressionsRefreshRate()); } @Test(expected = IllegalArgumentException.class) @@ -92,13 +93,14 @@ public void cannotSetEventsFlushRateToEqualTo1000() { @Test public void eventsFlushRateWorks() { - SplitClientConfig.builder() + SplitClientConfig config = SplitClientConfig.builder() .eventFlushIntervalInMillis(1000) .build(); + Assert.assertEquals(1000, config.eventSendIntervalInMillis()); } @Test(expected = IllegalArgumentException.class) - public void cannotSetMetricsRefreshRateToLessTha30() { + public void cannotSetMetricsRefreshRateToLessThan30() { SplitClientConfig.builder() .metricsRefreshRate(29) .build(); @@ -106,12 +108,16 @@ public void cannotSetMetricsRefreshRateToLessTha30() { @Test public void canSetRefreshRatesTo30() { - SplitClientConfig.builder() + SplitClientConfig cfg = SplitClientConfig.builder() .featuresRefreshRate(30) .segmentsRefreshRate(30) - .impressionsRefreshRate(30) - .metricsRefreshRate(30) + .impressionsRefreshRate(65) + .metricsRefreshRate(65) .build(); + Assert.assertEquals(30, cfg.featuresRefreshRate()); + Assert.assertEquals(30, cfg.segmentsRefreshRate()); + Assert.assertEquals(65, cfg.impressionsRefreshRate()); + Assert.assertEquals(65, cfg.metricsRefreshRate()); } @Test @@ -175,6 +181,7 @@ public void streamingReconnectBackoffBaseAllowed() { SplitClientConfig cfg = SplitClientConfig.builder() .streamingReconnectBackoffBase(1) .build(); + Assert.assertEquals(1, cfg.streamingReconnectBackoffBase()); } @Test