You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/03/18 00:13:55 UTC

svn commit: r1735521 - /qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java

Author: rgodfrey
Date: Thu Mar 17 23:13:54 2016
New Revision: 1735521

URL: http://svn.apache.org/viewvc?rev=1735521&view=rev
Log:
QPID-7151: Fix test broken by [~Lorenz.Quack]s previous commit :-)

Modified:
    qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java

Modified: qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java?rev=1735521&r1=1735520&r2=1735521&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java Thu Mar 17 23:13:54 2016
@@ -21,6 +21,8 @@
 package org.apache.qpid.server.management.plugin.auth;
 
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doThrow;
@@ -230,15 +232,9 @@ public class OAuth2InteractiveAuthentica
         assertTrue("Authenticator has failed unexpectedly", !(authenticationHandler instanceof OAuth2InteractiveAuthenticator.FailedAuthenticationHandler));
 
         HttpServletResponse mockResponse = mock(HttpServletResponse.class);
-        try
-        {
-            authenticationHandler.handleAuthentication(mockResponse);
-            fail("Authentication with invalid authorization code should not succeed");
-        }
-        catch (SecurityException e)
-        {
-            // pass
-        }
+        authenticationHandler.handleAuthentication(mockResponse);
+        verify(mockResponse).sendError(eq(401));
+
     }
 
     public void testUnauthorizedAuthorizationCode() throws Exception



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org