Skip to content

Commit

Permalink
refactor: extract method
Browse files Browse the repository at this point in the history
* Make it clearer that we're going to the logout.do service.
  • Loading branch information
swalchemist committed Nov 3, 2023
1 parent 54aa4b2 commit 0570028
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ public LogoutDoEndpoint(WebDriver driver) {
}

static public LoginPage logout_goesToLoginPage(WebDriver driver, String baseUrl, String redirectUrl, String clientId) {
driver.get(
baseUrl
+ urlPath
+ "?redirect=" + URLEncoder.encode(redirectUrl, StandardCharsets.UTF_8)
+ "&client_id=" + clientId
driver.get(buildLogoutDoUrl(baseUrl, redirectUrl, clientId)
);
return new LoginPage(driver);
}

private static String buildLogoutDoUrl(String baseUrl, String redirectUrl, String clientId) {
return baseUrl
+ urlPath
+ "?redirect=" + URLEncoder.encode(redirectUrl, StandardCharsets.UTF_8)
+ "&client_id=" + clientId;
}
}

0 comments on commit 0570028

Please sign in to comment.