[mule-scm] [mule] [15957] branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security: MULE-4561 Synchronous transports return request message rather than error when security exceptions occurs

View: New views
1 Messages — Rating Filter:   Alert me  

[mule-scm] [mule] [15957] branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security: MULE-4561 Synchronous transports return request message rather than error when security exceptions occurs

by dfeist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
[mule] [15957] branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security: MULE-4561 Synchronous transports return request message rather than error when security exceptions occurs
Revision
15957
Author
dfeist
Date
2009-11-03 14:52:43 -0600 (Tue, 03 Nov 2009)

Log Message

MULE-4561 Synchronous transports return request message rather than error when security exceptions occurs

Modified Paths

Diff

Modified: branches/mule-3.x/modules/spring-security/src/test/java/org/mule/module/spring/security/HttpFilterFunctionalTestCase.java (15956 => 15957)

--- branches/mule-3.x/modules/spring-security/src/test/java/org/mule/module/spring/security/HttpFilterFunctionalTestCase.java	2009-11-03 18:54:04 UTC (rev 15956)
+++ branches/mule-3.x/modules/spring-security/src/test/java/org/mule/module/spring/security/HttpFilterFunctionalTestCase.java	2009-11-03 20:52:43 UTC (rev 15957)
@@ -38,11 +38,7 @@
         {
             int status = client.executeMethod(get);
             assertEquals(HttpConstants.SC_UNAUTHORIZED, status);
-            assertEquals(
-                "Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter "
-                                + "but there was no security context on the session. Authentication denied on endpoint "
-                                + "http://localhost:4567. Message payload is of type: String",
-                get.getResponseBodyAsString());
+            assertEquals(getNoContextErrorResponse(), get.getResponseBodyAsString());
         }
         finally
         {
@@ -50,6 +46,13 @@
         }
     }
 
+    protected String getNoContextErrorResponse()
+    {
+        return "Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter "
+               + "but there was no security context on the session. Authentication denied on endpoint "
+               + "http://localhost:4567. Message payload is of type: String";
+    }
+
     public void testAuthenticationFailureBadCredentials() throws Exception
     {
         doRequest(null, "localhost", "anonX", "anonX", getUrl(), true, false, 401);
@@ -77,8 +80,7 @@
 
     public void testAuthenticationAuthorisedWithHandshakeAndRealm() throws Exception
     {
-        doRequest("mule-realm", "localhost", "ross", "ross", getUrl(), true, false,
-            200);
+        doRequest("mule-realm", "localhost", "ross", "ross", getUrl(), true, false, 200);
     }
 
     private void doRequest(String realm,

Modified: branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security/ServletHttpFilterFunctionalTestCase.java (15956 => 15957)

--- branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security/ServletHttpFilterFunctionalTestCase.java	2009-11-03 18:54:04 UTC (rev 15956)
+++ branches/mule-3.x/tests/integration/src/test/java/org/mule/test/integration/security/ServletHttpFilterFunctionalTestCase.java	2009-11-03 20:52:43 UTC (rev 15957)
@@ -51,5 +51,12 @@
 
         super.doTearDown();
     }
+    
+    protected String getNoContextErrorResponse()
+    {
+        return "Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter "
+               + "but there was no security context on the session. Authentication denied on endpoint "
+               + "servlet://test. Message payload is of type: String";
+    }
 
 }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email