}
@Override
protected void updateContextForAuthn(WebClient webClient, HtmlPage authorizationPage, MockWebContext context)
throws Exception {
final MockWebContext mockWebContext = context;
final HtmlForm form = authorizationPage.getForms().get(0);
final HtmlTextInput email = form.getInputByName("j_username");
email.setValueAttribute("myself");
final HtmlPasswordInput password = form.getInputByName("j_password");
password.setValueAttribute("myself");
final HtmlSubmitInput submit = form.getInputByValue("Login");
final HtmlPage callbackPage = submit.click();
String samlResponse = ((HtmlInput) callbackPage.getElementByName("SAMLResponse")).getValueAttribute();
String relayState = ((HtmlInput) callbackPage.getElementByName("RelayState")).getValueAttribute();
mockWebContext.addRequestParameter("SAMLResponse", samlResponse);
mockWebContext.addRequestParameter("RelayState", relayState);
mockWebContext.setRequestMethod("POST");
mockWebContext.setFullRequestURL(callbackPage.getForms().get(0).getActionAttribute());
}