Search in sources :

Example 11 with ActionType

use of org.simbasecurity.api.service.thrift.ActionType in project simba-os by cegeka.

the class DoFilterAndSetPrincipalActionTest method testExecute_withoutPrincipal.

@Test
public void testExecute_withoutPrincipal() throws Exception {
    FilterChain filterChain = mock(FilterChain.class);
    ActionDescriptor actionDescriptor = new ActionDescriptor(new HashSet<ActionType>(), new HashMap<String, String>(), null, null, null, null);
    actionDescriptor.getActionTypes().add(ActionType.DO_FILTER_AND_SET_PRINCIPAL);
    DoFilterAndSetPrincipalAction action = new DoFilterAndSetPrincipalAction(actionDescriptor);
    action.setRequest(request);
    action.setResponse(response);
    action.setFilterChain(filterChain);
    action.execute();
    verify(filterChain).doFilter(request, response);
}
Also used : ActionType(org.simbasecurity.api.service.thrift.ActionType) FilterChain(javax.servlet.FilterChain) ActionDescriptor(org.simbasecurity.api.service.thrift.ActionDescriptor) Test(org.junit.Test)

Aggregations

ActionType (org.simbasecurity.api.service.thrift.ActionType)11 Test (org.junit.Test)10 ActionDescriptor (org.simbasecurity.api.service.thrift.ActionDescriptor)10 LoginMapping (org.simbasecurity.core.domain.LoginMapping)4 LoginMappingEntity (org.simbasecurity.core.domain.LoginMappingEntity)4 FilterChain (javax.servlet.FilterChain)2 ArrayList (java.util.ArrayList)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Ignore (org.junit.Ignore)1 SSOToken (org.simbasecurity.api.service.thrift.SSOToken)1 HttpServletRequestWithPrincipal (org.simbasecurity.client.filter.request.HttpServletRequestWithPrincipal)1