final String logoutRequest = "<samlp:LogoutRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"LR-1-B2b0CVRW5eSvPBZPsAVXdNPj7jee4SWjr9y\" Version=\"2.0\" IssueInstant=\"2012-12-19T15:30:55Z\"><saml:NameID xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">@NOT_USED@</saml:NameID><samlp:SessionIndex>ST-1-FUUhL26EgrkcD6I2Mry9-cas01.example.org</samlp:SessionIndex></samlp:LogoutRequest>";
final CasClient casClient = new CasClient();
casClient.setCallbackUrl(CALLBACK_URL);
casClient.setCasLoginUrl(LOGIN_URL);
casClient.init();
final MockWebContext context = MockWebContext.create().addRequestParameter("logoutRequest", logoutRequest)
.setRequestMethod("POST");
try {
casClient.getCredentials(context);
fail("should throw RequiresHttpAction");
} catch (final RequiresHttpAction e) {
assertEquals(200, context.getResponseStatus());
assertEquals("logout request : no credential returned", e.getMessage());
}
}