Skip to content

Commit

Permalink
feat(jans-linux-setup): status list must be enabled during tests #8838 (
Browse files Browse the repository at this point in the history
#8839)

#8838

Signed-off-by: YuriyZ <yzabrovarniy@gmail.com>
  • Loading branch information
yuriyz committed Jul 3, 2024
1 parent 90a98de commit ca7e04c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,15 @@ private WebElement waitForRequredElementLoad(WebDriver currentDriver, String id)
.pollingEvery(Duration.ofMillis(1000))
.ignoring(NoSuchElementException.class);

WebElement loginButton = wait.until(d -> {
return d.findElement(By.id(id));
});
return loginButton;
try {
WebElement loginButton = wait.until(d -> d.findElement(By.id(id)));
return loginButton;
} catch (TimeoutException e) {
System.out.println("PAGE URL: " + currentDriver.getCurrentUrl());
System.out.println("PAGE SOURCE: ");
System.out.println(currentDriver.getPageSource());
throw e;
}
}

protected String acceptAuthorization(WebDriver currentDriver, String redirectUri) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public void statusList(
TokenResponse tokenResponse = tokenClient.exec();

showClient(tokenClient);
System.out.println("ACCESS_TOKEN");
System.out.println("statusList - ACCESS_TOKEN");
System.out.println(tokenResponse.getAccessToken());
Jwt accessTokenJwt = Jwt.parseOrThrow(tokenResponse.getAccessToken());
final int accessTokenIndex = accessTokenJwt.getClaims().getClaimAsJSON("status").getJSONObject("status_list").getInt("idx");
System.out.println("ACCESS_TOKEN idx: " + accessTokenIndex);
System.out.println("statusList - ACCESS_TOKEN idx: " + accessTokenIndex);

assertEquals(TokenStatus.VALID, loadStatus(accessTokenIndex));

revokeAccessToken(clientIdAndSecret, tokenResponse.getAccessToken());

System.out.println("ACCESS_TOKEN idx: " + accessTokenIndex); // re-print for convenience
System.out.println("statusList - ACCESS_TOKEN idx: " + accessTokenIndex); // re-print for convenience
// give time to let status went to list
Thread.sleep(2000);
assertEquals(TokenStatus.INVALID, loadStatus(accessTokenIndex));
Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/test_data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def load_test_data(self):
'tokenEndpointAuthMethodsSupported': [ 'client_secret_basic', 'client_secret_post', 'client_secret_jwt', 'private_key_jwt', 'tls_client_auth', 'self_signed_tls_client_auth', 'none' ],
'sessionIdRequestParameterEnabled': True,
'skipRefreshTokenDuringRefreshing': False,
'featureFlags': ['unknown', 'health_check', 'userinfo', 'clientinfo', 'id_generation', 'registration', 'introspection', 'revoke_token', 'revoke_session', 'global_token_revocation', 'end_session', 'status_session', 'jans_configuration', 'ciba', 'uma', 'u2f', 'device_authz', 'stat', 'par', 'ssa'],
'featureFlags': ['unknown', 'health_check', 'userinfo', 'clientinfo', 'id_generation', 'registration', 'introspection', 'revoke_token', 'revoke_session', 'global_token_revocation', 'end_session', 'status_session', 'jans_configuration', 'ciba', 'uma', 'u2f', 'device_authz', 'stat', 'par', 'ssa', 'status_list'],
'cleanServiceInterval':7200,
'loggingLevel': 'TRACE',
}
Expand Down

0 comments on commit ca7e04c

Please sign in to comment.