use of ddf.security.http.impl.HttpSessionFactory in project ddf by codice.
the class AuthenticationEndpointTest method setup.
@Before
public void setup() throws SecurityServiceException, URISyntaxException {
HttpSessionFactory sessionFactory = mock(HttpSessionFactory.class);
HttpSession session = mock(HttpSession.class);
when(session.getAttribute(SecurityConstants.SAML_ASSERTION)).thenReturn(mock(SecurityTokenHolder.class));
when(sessionFactory.getOrCreateSession(any())).thenReturn(session);
policyManager = mock(ContextPolicyManager.class);
securityManager = mock(SecurityManager.class);
authEndpoint = new AuthenticationEndpoint(policyManager, securityManager, sessionFactory);
UriInfo uriInfo = mock(UriInfo.class);
UriBuilder uriBuilder = mock(UriBuilder.class);
when(uriInfo.getBaseUriBuilder()).thenReturn(uriBuilder);
when(uriBuilder.replacePath(anyString())).thenReturn(uriBuilder);
when(uriBuilder.build()).thenReturn(new URI(URL));
authEndpoint.uriInfo = uriInfo;
mockUser(USER_NAME, PASSWORD, REALM);
}
Aggregations