use of org.apereo.cas.logout.DefaultLogoutRequest in project cas by apereo.
the class LogoutActionTests method verifyLogoutRequestBack.
@Test
public void verifyLogoutRequestBack() throws Exception {
final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
this.request.setCookies(cookie);
final LogoutRequest logoutRequest = new DefaultLogoutRequest(StringUtils.EMPTY, null, null);
logoutRequest.setStatus(LogoutRequestStatus.SUCCESS);
WebUtils.putLogoutRequests(this.requestContext, Arrays.asList(logoutRequest));
final LogoutProperties properties = new LogoutProperties();
this.logoutAction = new LogoutAction(getWebApplicationServiceFactory(), this.serviceManager, properties);
final Event event = this.logoutAction.doExecute(this.requestContext);
assertEquals(CasWebflowConstants.TRANSITION_ID_FINISH, event.getId());
}
use of org.apereo.cas.logout.DefaultLogoutRequest in project cas by apereo.
the class LogoutActionTests method verifyLogoutRequestFront.
@SuppressWarnings("unchecked")
@Test
public void verifyLogoutRequestFront() throws Exception {
final Cookie cookie = new Cookie(COOKIE_TGC_ID, "test");
this.request.setCookies(cookie);
final LogoutRequest logoutRequest = new DefaultLogoutRequest(StringUtils.EMPTY, null, null);
WebUtils.putLogoutRequests(this.requestContext, Arrays.asList(logoutRequest));
final LogoutProperties properties = new LogoutProperties();
this.logoutAction = new LogoutAction(getWebApplicationServiceFactory(), this.serviceManager, properties);
final Event event = this.logoutAction.doExecute(this.requestContext);
assertEquals(CasWebflowConstants.TRANSITION_ID_FRONT, event.getId());
final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(this.requestContext);
assertEquals(1, logoutRequests.size());
assertEquals(logoutRequest, logoutRequests.get(0));
}
Aggregations