diff --git a/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java b/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java index e3a6fe91c..ad9d4d583 100644 --- a/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java +++ b/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java @@ -56,7 +56,7 @@ public class TestHttpClientUtils { HttpResponse response = Mockito.mock(HttpResponse.class); HttpEntity entity = Mockito.mock(HttpEntity.class); Mockito.when(response.getEntity()).thenReturn(entity); - Mockito.when(entity.isStreaming()).thenReturn(false); + Mockito.when(entity.isStreaming()).thenReturn(Boolean.FALSE); HttpClientUtils.closeQuietly(response); Mockito.verify(entity, Mockito.never()).getContent(); } @@ -67,7 +67,7 @@ public class TestHttpClientUtils { HttpEntity entity = Mockito.mock(HttpEntity.class); InputStream instream = Mockito.mock(InputStream.class); Mockito.when(response.getEntity()).thenReturn(entity); - Mockito.when(entity.isStreaming()).thenReturn(true); + Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE); Mockito.when(entity.getContent()).thenReturn(instream); HttpClientUtils.closeQuietly(response); Mockito.verify(instream).close(); @@ -103,7 +103,7 @@ public class TestHttpClientUtils { CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class); HttpEntity entity = Mockito.mock(HttpEntity.class); Mockito.when(response.getEntity()).thenReturn(entity); - Mockito.when(entity.isStreaming()).thenReturn(false); + Mockito.when(entity.isStreaming()).thenReturn(Boolean.FALSE); HttpClientUtils.closeQuietly(response); Mockito.verify(entity, Mockito.never()).getContent(); Mockito.verify(response).close(); @@ -115,7 +115,7 @@ public class TestHttpClientUtils { HttpEntity entity = Mockito.mock(HttpEntity.class); InputStream instream = Mockito.mock(InputStream.class); Mockito.when(response.getEntity()).thenReturn(entity); - Mockito.when(entity.isStreaming()).thenReturn(true); + Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE); Mockito.when(entity.getContent()).thenReturn(instream); HttpClientUtils.closeQuietly(response); Mockito.verify(instream).close(); diff --git a/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java b/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java index 59a018b3c..838f5ac02 100644 --- a/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java +++ b/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java @@ -49,7 +49,7 @@ public class TestEofSensorInputStream { @Test public void testClose() throws Exception { - Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(Boolean.TRUE); eofstream.close(); @@ -79,7 +79,7 @@ public class TestEofSensorInputStream { @Test public void testReleaseConnection() throws Exception { - Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.streamClosed(Mockito.any())).thenReturn(Boolean.TRUE); eofstream.releaseConnection(); @@ -94,7 +94,7 @@ public class TestEofSensorInputStream { @Test public void testAbortConnection() throws Exception { - Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(Boolean.TRUE); eofstream.abortConnection(); @@ -124,7 +124,7 @@ public class TestEofSensorInputStream { @Test public void testRead() throws Exception { - Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE); Mockito.when(instream.read()).thenReturn(0, -1); Assert.assertEquals(0, eofstream.read()); @@ -147,7 +147,7 @@ public class TestEofSensorInputStream { @Test public void testReadIOError() throws Exception { - Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE); Mockito.when(instream.read()).thenThrow(new IOException()); try { @@ -163,7 +163,7 @@ public class TestEofSensorInputStream { @Test public void testReadByteArray() throws Exception { - Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE); Mockito.when(instream.read(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())) .thenReturn(1, -1); @@ -189,7 +189,7 @@ public class TestEofSensorInputStream { @Test public void testReadByteArrayIOError() throws Exception { - Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.eofDetected(Mockito.any())).thenReturn(Boolean.TRUE); Mockito.when(instream.read(Mockito.any(), Mockito.anyInt(), Mockito.anyInt())) .thenThrow(new IOException()); @@ -207,7 +207,7 @@ public class TestEofSensorInputStream { @Test public void testReadAfterAbort() throws Exception { - Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(true); + Mockito.when(eofwatcher.streamAbort(Mockito.any())).thenReturn(Boolean.TRUE); eofstream.abortConnection(); diff --git a/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java b/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java index 8ce1bc57b..ad10b45a9 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java @@ -84,7 +84,7 @@ public class TestHttpAuthenticator { this.authState = new AuthState(); this.authScheme = Mockito.mock(ContextAwareAuthScheme.class); Mockito.when(this.authScheme.getSchemeName()).thenReturn("Basic"); - Mockito.when(this.authScheme.isComplete()).thenReturn(true); + Mockito.when(this.authScheme.isComplete()).thenReturn(Boolean.TRUE); this.context = new BasicHttpContext(); this.host = new HttpHost("localhost", 80); this.proxy = new HttpHost("localhost", 8888); diff --git a/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java b/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java index 78c19ddc9..9edb3ad53 100644 --- a/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java +++ b/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java @@ -97,7 +97,7 @@ public class TestHttpClientConnectionManagerBase { CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn, -1, TimeUnit.MILLISECONDS); - Mockito.when(future.isCancelled()).thenReturn(false); + Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry); Mockito.when(pool.lease(route, null, null)).thenReturn(future); @@ -120,7 +120,7 @@ public class TestHttpClientConnectionManagerBase { CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn, -1, TimeUnit.MILLISECONDS); - Mockito.when(future.isCancelled()).thenReturn(true); + Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry); Mockito.when(pool.lease(route, null, null)).thenReturn(future); @@ -133,7 +133,7 @@ public class TestHttpClientConnectionManagerBase { HttpHost target = new HttpHost("localhost"); HttpRoute route = new HttpRoute(target); - Mockito.when(future.isCancelled()).thenReturn(true); + Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenThrow(new TimeoutException()); Mockito.when(pool.lease(route, null, null)).thenReturn(future); @@ -149,10 +149,10 @@ public class TestHttpClientConnectionManagerBase { CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn, -1, TimeUnit.MILLISECONDS)); - Mockito.when(future.isCancelled()).thenReturn(false); + Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry); Mockito.when(pool.lease(route, null, null)).thenReturn(future); - Mockito.when(conn.isOpen()).thenReturn(true); + Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE); ConnectionRequest connRequest1 = mgr.requestConnection(route, null); HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS); @@ -174,10 +174,10 @@ public class TestHttpClientConnectionManagerBase { CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn, -1, TimeUnit.MILLISECONDS)); - Mockito.when(future.isCancelled()).thenReturn(false); + Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry); Mockito.when(pool.lease(route, null, null)).thenReturn(future); - Mockito.when(conn.isOpen()).thenReturn(false); + Mockito.when(conn.isOpen()).thenReturn(Boolean.FALSE); ConnectionRequest connRequest1 = mgr.requestConnection(route, null); HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS);