Add more information for SAML2 tests failure
This commit is contained in:
parent
738463be8c
commit
70891cd497
|
@ -82,7 +82,19 @@ public class Saml2JavaConfigurationITests {
|
|||
HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
|
||||
HtmlPage loginPage = rpLogoutButton.click();
|
||||
this.webClient.waitForBackgroundJavaScript(10000);
|
||||
assertThat(loginPage.getUrl().getFile()).isEqualTo("/login?logout");
|
||||
List<String> urls = new ArrayList<>();
|
||||
urls.add(loginPage.getUrl().getFile());
|
||||
urls.add(((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).getUrl().getFile());
|
||||
assertThat(urls).withFailMessage(() -> {
|
||||
// @formatter:off
|
||||
String builder = loginPage.asXml()
|
||||
+ "\n\n\n"
|
||||
+ "Enclosing Page"
|
||||
+ "\n\n\n"
|
||||
+ ((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).asXml();
|
||||
// @formatter:on
|
||||
return builder;
|
||||
}).contains("/login?logout");
|
||||
}
|
||||
|
||||
private void performLogin() throws Exception {
|
||||
|
|
|
@ -63,7 +63,19 @@ public class Saml2LoginApplicationITests {
|
|||
HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
|
||||
HtmlPage loginPage = rpLogoutButton.click();
|
||||
this.webClient.waitForBackgroundJavaScript(10000);
|
||||
assertThat(loginPage.getUrl().getFile()).isEqualTo("/login?logout");
|
||||
List<String> urls = new ArrayList<>();
|
||||
urls.add(loginPage.getUrl().getFile());
|
||||
urls.add(((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).getUrl().getFile());
|
||||
assertThat(urls).withFailMessage(() -> {
|
||||
// @formatter:off
|
||||
String builder = loginPage.asXml()
|
||||
+ "\n\n\n"
|
||||
+ "Enclosing Page"
|
||||
+ "\n\n\n"
|
||||
+ ((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).asXml();
|
||||
// @formatter:on
|
||||
return builder;
|
||||
}).contains("/login?logout");
|
||||
}
|
||||
|
||||
private void performLogin() throws Exception {
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
package example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.gargoylesoftware.htmlunit.ElementNotFoundException;
|
||||
import com.gargoylesoftware.htmlunit.WebClient;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlElement;
|
||||
|
@ -63,7 +66,19 @@ public class Saml2LoginApplicationITests {
|
|||
HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
|
||||
HtmlPage loginPage = rpLogoutButton.click();
|
||||
this.webClient.waitForBackgroundJavaScript(10000);
|
||||
assertThat(loginPage.getUrl().getFile()).isEqualTo("/login?logout");
|
||||
List<String> urls = new ArrayList<>();
|
||||
urls.add(loginPage.getUrl().getFile());
|
||||
urls.add(((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).getUrl().getFile());
|
||||
assertThat(urls).withFailMessage(() -> {
|
||||
// @formatter:off
|
||||
String builder = loginPage.asXml()
|
||||
+ "\n\n\n"
|
||||
+ "Enclosing Page"
|
||||
+ "\n\n\n"
|
||||
+ ((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).asXml();
|
||||
// @formatter:on
|
||||
return builder;
|
||||
}).contains("/login?logout");
|
||||
}
|
||||
|
||||
private void performLogin() throws Exception {
|
||||
|
|
|
@ -80,7 +80,19 @@ public class Saml2XmlITests {
|
|||
HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
|
||||
HtmlPage loginPage = rpLogoutButton.click();
|
||||
this.webClient.waitForBackgroundJavaScript(10000);
|
||||
assertThat(loginPage.getUrl().getFile()).isEqualTo("/login?logout");
|
||||
List<String> urls = new ArrayList<>();
|
||||
urls.add(loginPage.getUrl().getFile());
|
||||
urls.add(((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).getUrl().getFile());
|
||||
assertThat(urls).withFailMessage(() -> {
|
||||
// @formatter:off
|
||||
String builder = loginPage.asXml()
|
||||
+ "\n\n\n"
|
||||
+ "Enclosing Page"
|
||||
+ "\n\n\n"
|
||||
+ ((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).asXml();
|
||||
// @formatter:on
|
||||
return builder;
|
||||
}).contains("/login?logout");
|
||||
}
|
||||
|
||||
private void performLogin() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue