[java-identity-provider] branch master updated: JPAR-133 - Fix Mockito deprecations from Mockito v2

Ian Young ian at iay.org.uk
Fri Mar 8 09:49:33 EST 2019


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=12401abf596faee422a4ab1e6d3f01b63f5aaa2c

The following commit(s) were added to refs/heads/master by this push:
       new  12401ab   JPAR-133 - Fix Mockito deprecations from Mockito v2
12401ab is described below

commit 12401abf596faee422a4ab1e6d3f01b63f5aaa2c
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Fri Mar 8 14:49:28 2019 +0000

    JPAR-133 - Fix Mockito deprecations from Mockito v2
---
 .../spnego/impl/SPNEGOAuthnControllerTest.java     | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnControllerTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnControllerTest.java
index c95ff49..01c13f2 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnControllerTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/spnego/impl/SPNEGOAuthnControllerTest.java
@@ -17,7 +17,7 @@
 
 package net.shibboleth.idp.authn.spnego.impl;
 
-import static org.mockito.Matchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -44,7 +44,7 @@ import net.shibboleth.utilities.java.support.codec.Base64Support;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSException;
 import org.ietf.jgss.GSSName;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.springframework.http.HttpHeaders;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -244,7 +244,7 @@ public class SPNEGOAuthnControllerTest {
     public void givenSuccessfulGSSContextAcceptorInstantiation_continueSPNEGO_shouldHaveSetAcceptorInSPNEGOContext()
             throws ExternalAuthenticationException, IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(false);
@@ -276,7 +276,7 @@ public class SPNEGOAuthnControllerTest {
             throws ExternalAuthenticationException, IOException, LoginException, GSSException,
             PrivilegedActionException, Exception {
         RuntimeException e = new RuntimeException();
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenThrow(e);
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenThrow(e);
         MockHttpServletRequest req = buildSPNEGOHttpServletRequest(NEGOTIATE_HEADER_DATA);
         ModelAndView mv =
                 mockedGSSController.continueSPNEGO(TEST_CONVERSATION_KEY, "Negotiate " + NEGOTIATE_HEADER_DATA, req,
@@ -290,7 +290,7 @@ public class SPNEGOAuthnControllerTest {
     @Test
     public void withoutGSSContext_continueSPNEGO_shouldReturnModelAndView() throws LoginException, GSSException,
             PrivilegedActionException, ExternalAuthenticationException, IOException, Exception {
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(null);
         MockHttpServletRequest req = buildSPNEGOHttpServletRequest(NEGOTIATE_HEADER_DATA);
@@ -302,7 +302,7 @@ public class SPNEGOAuthnControllerTest {
     @Test
     public void withoutGSSContext_continueSPNEGO_shouldReplyUnauthorizedNegotiate() throws LoginException,
             GSSException, PrivilegedActionException, ExternalAuthenticationException, IOException, Exception {
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(null);
         MockHttpServletRequest req = buildSPNEGOHttpServletRequest(NEGOTIATE_HEADER_DATA);
@@ -315,7 +315,7 @@ public class SPNEGOAuthnControllerTest {
     public void givenGSSContextNotEstablished_continueSPNEGO_shouldReturnModelAndView() throws LoginException,
             GSSException, PrivilegedActionException, ExternalAuthenticationException, IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(false);
@@ -329,7 +329,7 @@ public class SPNEGOAuthnControllerTest {
     public void givenGSSContextNotEstablished_continueSPNEGO_shouldReplyUnauthorizedNegotiate() throws LoginException,
             GSSException, PrivilegedActionException, ExternalAuthenticationException, IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(false);
@@ -345,7 +345,7 @@ public class SPNEGOAuthnControllerTest {
             IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
         GSSException gssException = new GSSException(0);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(true);
@@ -364,7 +364,7 @@ public class SPNEGOAuthnControllerTest {
             PrivilegedActionException, ExternalAuthenticationException, IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
         GSSName mockGssName = mock(GSSName.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(true);
@@ -381,7 +381,7 @@ public class SPNEGOAuthnControllerTest {
             IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
         GSSName mockGssName = mock(GSSName.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(true);
@@ -400,7 +400,7 @@ public class SPNEGOAuthnControllerTest {
             throws LoginException, GSSException, PrivilegedActionException, ExternalAuthenticationException,
             IOException, Exception {
         GSSContext mockGSSContext = mock(GSSContext.class);
-        when(mockGSSContextAcceptor.acceptSecContext(Matchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
+        when(mockGSSContextAcceptor.acceptSecContext(ArgumentMatchers.<byte[]> any(), anyInt(), anyInt())).thenReturn(
                 "tokenBytes".getBytes());
         when(mockGSSContextAcceptor.getContext()).thenReturn(mockGSSContext);
         when(mockGSSContext.isEstablished()).thenReturn(true);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list