hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1791942 - in /httpcomponents/httpcore/trunk: ./ httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/ httpcore5/src/test/java/org/apache/hc/core5/http/...
Date Wed, 19 Apr 2017 16:39:42 GMT
Author: olegk
Date: Wed Apr 19 16:39:42 2017
New Revision: 1791942

URL: http://svn.apache.org/viewvc?rev=1791942&view=rev
Log:
Upgraded to Mockito 2.7

Modified:
    httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ClientTestingAdapter.java
    httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
    httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
    httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
    httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
    httpcomponents/httpcore/trunk/pom.xml

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ClientTestingAdapter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ClientTestingAdapter.java?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ClientTestingAdapter.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/framework/ClientTestingAdapter.java
Wed Apr 19 16:39:42 2017
@@ -110,7 +110,7 @@ public class ClientTestingAdapter {
      * See the documentation for the same method in {@link ClientPOJOAdapter}.
      */
     public boolean isRequestSupported(final Map<String, Object> request) {
-        return (adapter == null) ? true : adapter.checkRequestSupport(request) == null;
+        return (adapter == null) || adapter.checkRequestSupport(request) == null;
     };
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
Wed Apr 19 16:39:42 2017
@@ -44,9 +44,9 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.ProtocolVersion;
-import org.apache.hc.core5.http.ContentType;
 import org.hamcrest.BaseMatcher;
 import org.hamcrest.Description;
 import org.hamcrest.Matcher;
@@ -129,7 +129,7 @@ public class TestTestingFramework {
         final ClientTestingAdapter adapter = Mockito.mock(ClientTestingAdapter.class);
 
         // Have isRequestSupported() return false so no test will run.
-        Mockito.when(adapter.isRequestSupported(Mockito.anyMap()))
+        Mockito.when(adapter.isRequestSupported(Mockito.<String, Object>anyMap()))
                      .thenReturn(false);
 
         final TestingFramework framework = newWebServerTestingFramework(adapter);
@@ -142,8 +142,8 @@ public class TestTestingFramework {
 
     @SuppressWarnings("unchecked")
     private void verifyCallMethodNeverCalled(final ClientTestingAdapter adapter) throws Exception
{
-        Mockito.verify(adapter, Mockito.never()).execute(Mockito.anyString(), Mockito.anyMap(),
-                       Mockito.any(TestingFrameworkRequestHandler.class), Mockito.anyMap());
+        Mockito.verify(adapter, Mockito.never()).execute(Mockito.anyString(), Mockito.<String,
Object>anyMap(),
+                       Mockito.any(TestingFrameworkRequestHandler.class), Mockito.<String,
Object>anyMap());
     }
 
     private TestingFramework newFrameworkAndSetAdapter(final ClientTestingAdapter adapter)

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
Wed Apr 19 16:39:42 2017
@@ -38,7 +38,7 @@ import org.apache.hc.core5.http.message.
 import org.apache.hc.core5.http.nio.SessionOutputBuffer;
 import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mockito;
 
 /**
@@ -128,7 +128,7 @@ public class TestChunkEncoder {
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
 
         outbuf.flush(channel);
         final String s = channel.dump(StandardCharsets.US_ASCII);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
Wed Apr 19 16:39:42 2017
@@ -41,7 +41,7 @@ import org.apache.hc.core5.util.CharArra
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mockito;
 
 /**
@@ -318,8 +318,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 0);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -342,8 +342,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 32);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -365,8 +365,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -389,8 +389,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 2);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -413,8 +413,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -438,8 +438,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -465,8 +465,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -487,8 +487,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
 
-        Mockito.verify(channel, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -510,8 +510,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -540,8 +540,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(6)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(6)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -565,8 +565,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
Wed Apr 19 16:39:42 2017
@@ -41,7 +41,7 @@ import org.apache.hc.core5.util.CharArra
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mockito;
 
 /**
@@ -377,8 +377,8 @@ public class TestLengthDelimitedEncoder
             100, 0);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -402,8 +402,8 @@ public class TestLengthDelimitedEncoder
             100, 32);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -426,8 +426,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -450,8 +450,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff; and a lot
more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -475,8 +475,8 @@ public class TestLengthDelimitedEncoder
             100, 2);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -500,8 +500,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -526,8 +526,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -554,8 +554,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -577,8 +577,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
 
-        Mockito.verify(channel, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -601,8 +601,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -632,8 +632,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(6)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(6)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -658,8 +658,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(ArgumentMatchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());

Modified: httpcomponents/httpcore/trunk/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/pom.xml?rev=1791942&r1=1791941&r2=1791942&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/pom.xml (original)
+++ httpcomponents/httpcore/trunk/pom.xml Wed Apr 19 16:39:42 2017
@@ -78,7 +78,7 @@
     <maven.compiler.target>1.7</maven.compiler.target>
     <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
     <junit.version>4.12</junit.version>
-    <mockito.version>1.10.19</mockito.version>
+    <mockito.version>2.7.22</mockito.version>
     <log4j.version>2.8</log4j.version>
     <hc.stylecheck.version>1</hc.stylecheck.version>
   </properties>



Mime
View raw message