File tree Expand file tree Collapse file tree 4 files changed +55
-4
lines changed
java-configuration/saml2/login/src/integTest/java/example
login-single-tenant/src/integTest/java/example
login/src/integTest/java/example
xml/java/saml2/login-logout/src/integTest/java/example Expand file tree Collapse file tree 4 files changed +55
-4
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,19 @@ void logoutWhenRelyingPartyInitiatedLogoutThenLoginPageWithLogoutParam() throws
82
82
HtmlElement rpLogoutButton = home .getHtmlElementById ("rp_logout_button" );
83
83
HtmlPage loginPage = rpLogoutButton .click ();
84
84
this .webClient .waitForBackgroundJavaScript (10000 );
85
- assertThat (loginPage .getUrl ().getFile ()).isEqualTo ("/login?logout" );
85
+ List <String > urls = new ArrayList <>();
86
+ urls .add (loginPage .getUrl ().getFile ());
87
+ urls .add (((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).getUrl ().getFile ());
88
+ assertThat (urls ).withFailMessage (() -> {
89
+ // @formatter:off
90
+ String builder = loginPage .asXml ()
91
+ + "\n \n \n "
92
+ + "Enclosing Page"
93
+ + "\n \n \n "
94
+ + ((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).asXml ();
95
+ // @formatter:on
96
+ return builder ;
97
+ }).contains ("/login?logout" );
86
98
}
87
99
88
100
private void performLogin () throws Exception {
Original file line number Diff line number Diff line change @@ -63,7 +63,19 @@ void logoutWhenRelyingPartyInitiatedLogoutThenLoginPageWithLogoutParam() throws
63
63
HtmlElement rpLogoutButton = home .getHtmlElementById ("rp_logout_button" );
64
64
HtmlPage loginPage = rpLogoutButton .click ();
65
65
this .webClient .waitForBackgroundJavaScript (10000 );
66
- assertThat (loginPage .getUrl ().getFile ()).isEqualTo ("/login?logout" );
66
+ List <String > urls = new ArrayList <>();
67
+ urls .add (loginPage .getUrl ().getFile ());
68
+ urls .add (((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).getUrl ().getFile ());
69
+ assertThat (urls ).withFailMessage (() -> {
70
+ // @formatter:off
71
+ String builder = loginPage .asXml ()
72
+ + "\n \n \n "
73
+ + "Enclosing Page"
74
+ + "\n \n \n "
75
+ + ((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).asXml ();
76
+ // @formatter:on
77
+ return builder ;
78
+ }).contains ("/login?logout" );
67
79
}
68
80
69
81
private void performLogin () throws Exception {
Original file line number Diff line number Diff line change 16
16
17
17
package example ;
18
18
19
+ import java .util .ArrayList ;
20
+ import java .util .List ;
21
+
19
22
import com .gargoylesoftware .htmlunit .ElementNotFoundException ;
20
23
import com .gargoylesoftware .htmlunit .WebClient ;
21
24
import com .gargoylesoftware .htmlunit .html .HtmlElement ;
@@ -63,7 +66,19 @@ void logoutWhenRelyingPartyInitiatedLogoutThenLoginPageWithLogoutParam() throws
63
66
HtmlElement rpLogoutButton = home .getHtmlElementById ("rp_logout_button" );
64
67
HtmlPage loginPage = rpLogoutButton .click ();
65
68
this .webClient .waitForBackgroundJavaScript (10000 );
66
- assertThat (loginPage .getUrl ().getFile ()).isEqualTo ("/login?logout" );
69
+ List <String > urls = new ArrayList <>();
70
+ urls .add (loginPage .getUrl ().getFile ());
71
+ urls .add (((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).getUrl ().getFile ());
72
+ assertThat (urls ).withFailMessage (() -> {
73
+ // @formatter:off
74
+ String builder = loginPage .asXml ()
75
+ + "\n \n \n "
76
+ + "Enclosing Page"
77
+ + "\n \n \n "
78
+ + ((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).asXml ();
79
+ // @formatter:on
80
+ return builder ;
81
+ }).contains ("/login?logout" );
67
82
}
68
83
69
84
private void performLogin () throws Exception {
Original file line number Diff line number Diff line change @@ -80,7 +80,19 @@ void logoutWhenRelyingPartyInitiatedLogoutThenLoginPageWithLogoutParam() throws
80
80
HtmlElement rpLogoutButton = home .getHtmlElementById ("rp_logout_button" );
81
81
HtmlPage loginPage = rpLogoutButton .click ();
82
82
this .webClient .waitForBackgroundJavaScript (10000 );
83
- assertThat (loginPage .getUrl ().getFile ()).isEqualTo ("/login?logout" );
83
+ List <String > urls = new ArrayList <>();
84
+ urls .add (loginPage .getUrl ().getFile ());
85
+ urls .add (((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).getUrl ().getFile ());
86
+ assertThat (urls ).withFailMessage (() -> {
87
+ // @formatter:off
88
+ String builder = loginPage .asXml ()
89
+ + "\n \n \n "
90
+ + "Enclosing Page"
91
+ + "\n \n \n "
92
+ + ((HtmlPage ) this .webClient .getCurrentWindow ().getEnclosedPage ()).asXml ();
93
+ // @formatter:on
94
+ return builder ;
95
+ }).contains ("/login?logout" );
84
96
}
85
97
86
98
private void performLogin () throws Exception {
You can’t perform that action at this time.
0 commit comments