From 1276f8c3a5bf543242ad1b00a47f9872f9e2726c Mon Sep 17 00:00:00 2001 From: ARUS2023 <145485937+ARUS2023@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:14:21 -0500 Subject: [PATCH] Remove 8 unnecessary stubbings in PiwikTrackerTest.java (#138) --- .../java/org/matomo/java/tracking/PiwikTrackerTest.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/test/java/org/matomo/java/tracking/PiwikTrackerTest.java b/src/test/java/org/matomo/java/tracking/PiwikTrackerTest.java index b37a9ebc..6c1dcc12 100644 --- a/src/test/java/org/matomo/java/tracking/PiwikTrackerTest.java +++ b/src/test/java/org/matomo/java/tracking/PiwikTrackerTest.java @@ -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()); @@ -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."); @@ -324,7 +321,6 @@ public void testSendBulkRequestAsync_Iterable() throws Exception { HttpResponse response = mock(HttpResponse.class); Future future = mock(Future.class); doReturn(response).when(future).get(); - doReturn(true).when(future).isDone(); doReturn(future).when(piwikTracker).sendBulkRequestAsync(requests); @@ -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."); @@ -360,7 +354,6 @@ public void testSendBulkRequestAsync_Iterable_StringFF() throws Exception { HttpResponse response = mock(HttpResponse.class); Future future = mock(Future.class); doReturn(response).when(future).get(); - doReturn(true).when(future).isDone(); doReturn(PARAMETERS).when(request).getParameters(); requests.add(request); @@ -379,7 +372,6 @@ public void testSendBulkRequestAsync_Iterable_StringFT() throws Exception { HttpResponse response = mock(HttpResponse.class); Future future = mock(Future.class); doReturn(response).when(future).get(); - doReturn(true).when(future).isDone(); doReturn(PARAMETERS).when(request).getParameters(); requests.add(request);