use of org.simbasecurity.core.domain.Session in project simba-os by cegeka.
the class AuthenticationFilterServiceImpl method processRequest.
@Transactional
public ActionDescriptor processRequest(RequestData requestData, String chainCommand) throws TException {
return simbaExceptionHandlingCaller.call(() -> {
if (requestData == null) {
throw new IllegalArgumentException("Parameter 'requestData' can not be null");
}
if (chainCommand == null) {
throw new IllegalArgumentException("Parameter 'chainCommand' can not be null");
}
Command chain = locateCommandChain(chainCommand);
Session currentSession = getCurrentSession(requestData);
ChainContext chainContext = createChainContext(requestData, currentSession);
try {
chain.execute(chainContext);
} catch (Exception e) {
throw new RuntimeException(e);
}
return chainContext.getActionDescriptor();
});
}
use of org.simbasecurity.core.domain.Session in project simba-os by cegeka.
the class AuthenticationFilterServiceImplTest method testProcessRequest.
@Test
public void testProcessRequest() throws Exception {
Session sessionMock = mock(Session.class);
when(sessionServiceMock.getSession(any(SSOToken.class))).thenReturn(sessionMock);
ChainImpl authenticationChainMock = mock(ChainImpl.class);
when(applicationContext.getBean("authenticationChain")).thenReturn(authenticationChainMock);
serviceImpl.processRequest(new RequestData(null, null, null, null, null, null, false, false, false, false, false, null, null, "loginToken", null), "authenticationChain");
verify(authenticationChainMock).execute(any(ChainContext.class));
}
Aggregations