Package org.jboss.soa.esb.services.security

Examples of org.jboss.soa.esb.services.security.TestPrincipal


    final String userName = "testUser";
    final String password = "testPassword";
    Builder builder = new SecurityConfig.Builder("UserPassLogin");
    builder.callBackhandler("org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler");
    SecurityConfig configInfo = builder.build();
    TestPrincipal principal = new TestPrincipal(userName);
    Set<Object> credentials = new HashSet<Object>();
    credentials.add(password);

    AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder(principal, credentials).build();
    SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
View Full Code Here


        message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);

        final boolean processingResult = pipeline.process(message);

        assertTrue(processingResult);
        assertEquals(new TestPrincipal("test").getName(), MockSecuredActionProcessor.getSubject().getPrincipals().iterator().next().getName());
        assertEquals("The encrypted AuthenticationRequest should have been set as a thread local",
                encryptedAuthRequest, AuthenticationRequestImpl.getEncryptedAuthRequest());
        assertTrue("The SecurityContext should have been pushed", MockSecurityContextPropagator.wasPushCalled());
        assertTrue("The SerirityContext should have been popped", MockSecurityContextPropagator.wasPopCalled());
        assertNull("AuthenticationRequest should have been removed from the message context",
View Full Code Here

public class AuthenticationRequestUnitTest
{
  @Test
  public void contruct()
  {
    final Principal principal = new TestPrincipal("testUser");
    AuthenticationRequest request = new AuthenticationRequestImpl.Builder(principal, null ).build();
    assertEquals( principal, request.getPrincipal());
  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.services.security.TestPrincipal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.