View Javadoc

1   /*
2    * $Id: AuthenticationNamespaceHandlerFlowTestCase.java 22481 2011-07-21 04:21:24Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.spring.security;
12  
13  import static org.junit.Assert.assertEquals;
14  import static org.junit.Assert.assertNotNull;
15  
16  import org.mule.api.endpoint.ImmutableEndpoint;
17  import org.mule.construct.Flow;
18  import org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter;
19  
20  import org.junit.Test;
21  
22  public class AuthenticationNamespaceHandlerFlowTestCase extends AuthenticationNamespaceHandlerServiceTestCase
23  {
24      @Override
25      protected String getConfigResources()
26      {
27          return "authentication-config-flow.xml";
28      }
29   
30      @Test
31      public void testEndpointConfiguration()
32      {
33          Flow flow = muleContext.getRegistry().lookupObject("echo");
34          assertNotNull(flow);       
35  
36          ImmutableEndpoint endpoint = (ImmutableEndpoint) flow.getMessageSource();
37          assertNotNull(endpoint.getSecurityFilter());
38          assertEquals(HttpBasicAuthenticationFilter.class, endpoint.getSecurityFilter().getClass());
39      }
40  }