Skip to content

Commit 154a615

Browse files
Fixing travis
1 parent 70169ec commit 154a615

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

client/src/test/java/io/split/client/EventsClientImplTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99
import org.apache.hc.client5.http.impl.classic.HttpClients;
1010
import org.hamcrest.Matchers;
1111
import org.junit.Assert;
12+
import org.junit.Before;
1213
import org.junit.Test;
1314
import org.mockito.Mockito;
1415

1516
import java.io.IOException;
16-
import java.lang.reflect.Field;
17-
import java.lang.reflect.Modifier;
1817
import java.net.URI;
1918
import java.net.URISyntaxException;
20-
import java.util.concurrent.ExecutorService;
21-
import java.util.concurrent.Executors;
2219
import java.util.concurrent.LinkedBlockingQueue;
2320

2421
public class EventsClientImplTest {
@@ -82,21 +79,22 @@ public void testEventsFlushedWhenSizeLimitReached() throws URISyntaxException, I
8279

8380
@Test
8481
public void testEventDropped() throws URISyntaxException, NoSuchFieldException, IllegalAccessException, InterruptedException {
82+
TelemetryStorage telemetryStorage = Mockito.mock(InMemoryTelemetryStorage.class);
8583
CloseableHttpClient client = Mockito.mock(CloseableHttpClient.class);
8684
EventClientImpl eventClient = new EventClientImpl(new LinkedBlockingQueue<>(2),
8785
client,
8886
URI.create("https://kubernetesturl.com/split"),
8987
10000, // Long queue so it doesn't flush by # of events
9088
100000, // Long period so it doesn't flush by timeout expiration.
91-
0, TELEMETRY_STORAGE);
89+
0, telemetryStorage);
9290
eventClient.close();
9391
Thread.sleep(1000);
9492
for (int i = 0; i < 3; ++i) {
9593
Event event = new Event();
9694
eventClient.track(event, 1);
9795
}
9896

99-
Mockito.verify(TELEMETRY_STORAGE, Mockito.times(2)).recordEventStats(EventsDataRecordsEnum.EVENTS_QUEUED, 1);
100-
Mockito.verify(TELEMETRY_STORAGE, Mockito.times(1)).recordEventStats(EventsDataRecordsEnum.EVENTS_DROPPED, 1);
97+
Mockito.verify(telemetryStorage, Mockito.times(2)).recordEventStats(EventsDataRecordsEnum.EVENTS_QUEUED, 1);
98+
Mockito.verify(telemetryStorage, Mockito.times(1)).recordEventStats(EventsDataRecordsEnum.EVENTS_DROPPED, 1);
10199
}
102100
}

0 commit comments

Comments
 (0)