1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.security;
12
13 import org.mule.module.spring.security.HttpFilterFunctionalTestCase;
14 import org.mule.transport.servlet.MuleReceiverServlet;
15 import org.mule.transport.servlet.jetty.util.EmbeddedJettyServer;
16
17 public class ServletHttpFilterFunctionalTestCase extends HttpFilterFunctionalTestCase
18 {
19 public static final int HTTP_PORT = 4567;
20
21 private EmbeddedJettyServer httpServer;
22
23 @Override
24 protected String getConfigResources()
25 {
26 return "org/mule/test/integration/security/servlet-http-filter-test.xml";
27 }
28
29 @Override
30 protected String getUrl()
31 {
32 return "http://localhost:" + HTTP_PORT + "/test/index.html";
33 }
34
35 @Override
36 protected void doSetUp() throws Exception
37 {
38 super.doSetUp();
39
40 httpServer = new EmbeddedJettyServer(HTTP_PORT, "/", "/*", new MuleReceiverServlet(), muleContext);
41 httpServer.start();
42 }
43
44 @Override
45 protected void doTearDown() throws Exception
46 {
47 if (httpServer != null && httpServer.isStarted())
48 {
49 httpServer.stop();
50 }
51
52 super.doTearDown();
53 }
54
55 protected String getNoContextErrorResponse()
56 {
57 return "Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter "
58 + "but there was no security context on the session. Authentication denied on endpoint "
59 + "servlet://test. Message payload is of type: String";
60 }
61
62 }