Skip to content

Commit

Permalink
Remove 8 unnecessary stubbings in PiwikTrackerTest.java (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ARUS2023 authored Oct 10, 2023
1 parent 47f2083 commit 1276f8c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/test/java/org/matomo/java/tracking/PiwikTrackerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ public void testSendRequestAsync() throws Exception {
doReturn(client).when(piwikTracker).getHttpAsyncClient();
doReturn(PARAMETERS).when(request).getParameters();
doReturn(response).when(future).get();
doReturn(true).when(future).isDone();
doReturn(future).when(client)
.execute(argThat(new CorrectGetRequest("http://test.com?parameterName=parameterValue")), any());

Expand Down Expand Up @@ -273,9 +272,7 @@ public void testSendBulkRequest_Iterable_StringTT() {
HttpClient client = mock(HttpClient.class);
PiwikRequest request = mock(PiwikRequest.class);

doReturn(PARAMETERS).when(request).getParameters();
requests.add(request);
doReturn(client).when(piwikTracker).getHttpClient();

piwikTracker.sendBulkRequest(requests, "1");
fail("Exception should have been thrown.");
Expand Down Expand Up @@ -324,7 +321,6 @@ public void testSendBulkRequestAsync_Iterable() throws Exception {
HttpResponse response = mock(HttpResponse.class);
Future<HttpResponse> future = mock(Future.class);
doReturn(response).when(future).get();
doReturn(true).when(future).isDone();

doReturn(future).when(piwikTracker).sendBulkRequestAsync(requests);

Expand All @@ -341,9 +337,7 @@ public void testSendBulkRequestAsync_Iterable_StringTT() {
CloseableHttpAsyncClient client = mock(CloseableHttpAsyncClient.class);
PiwikRequest request = mock(PiwikRequest.class);

doReturn(PARAMETERS).when(request).getParameters();
requests.add(request);
doReturn(client).when(piwikTracker).getHttpAsyncClient();

piwikTracker.sendBulkRequestAsync(requests, "1");
fail("Exception should have been thrown.");
Expand All @@ -360,7 +354,6 @@ public void testSendBulkRequestAsync_Iterable_StringFF() throws Exception {
HttpResponse response = mock(HttpResponse.class);
Future<HttpResponse> future = mock(Future.class);
doReturn(response).when(future).get();
doReturn(true).when(future).isDone();

doReturn(PARAMETERS).when(request).getParameters();
requests.add(request);
Expand All @@ -379,7 +372,6 @@ public void testSendBulkRequestAsync_Iterable_StringFT() throws Exception {
HttpResponse response = mock(HttpResponse.class);
Future<HttpResponse> future = mock(Future.class);
doReturn(response).when(future).get();
doReturn(true).when(future).isDone();

doReturn(PARAMETERS).when(request).getParameters();
requests.add(request);
Expand Down

0 comments on commit 1276f8c

Please sign in to comment.