@Test void retrieveUsersTokenDetailsWhenSecurityContextIsEmpty() { SecurityContextHolder.clearContext(); TokenDetails tokenDetails = service.retrieveUsersTokenDetails(); assertThat(tokenDetails.isEmpty(), is(true)); }
public TokenDetails retrieveUsersTokenDetails() { TokenDetails tokenDetails = retrieveUsersTokenDetailsFromSecurityContext(); if (tokenDetails.isNotEmpty() && oidcAuthenticationHelper.isTokenExpiredOrShouldBeRefreshed(tokenDetails)) { return retrieveUpdatedUsersTokenDetails(tokenDetails); } return tokenDetails; }
UsersTokenService { public TokenDetails retrieveUsersTokenDetails() { TokenDetails tokenDetails = retrieveUsersTokenDetailsFromSecurityContext(); if (tokenDetails.isNotEmpty() && oidcAuthenticationHelper.isTokenExpiredOrShouldBeRefreshed(tokenDetails)) { return retrieveUpdatedUsersTokenDetails(tokenDetails); } return tokenDetails; } }
UsersTokenService { public TokenDetails retrieveUsersTokenDetails() { TokenDetails tokenDetails = retrieveUsersTokenDetailsFromSecurityContext(); if (tokenDetails.isNotEmpty() && oidcAuthenticationHelper.isTokenExpiredOrShouldBeRefreshed(tokenDetails)) { return retrieveUpdatedUsersTokenDetails(tokenDetails); } return tokenDetails; } @Autowired  UsersTokenService(OidcAuthenticationHelper oidcAuthenticationHelper,
                             OAuthClient oAuthClient); }
UsersTokenService { public TokenDetails retrieveUsersTokenDetails() { TokenDetails tokenDetails = retrieveUsersTokenDetailsFromSecurityContext(); if (tokenDetails.isNotEmpty() && oidcAuthenticationHelper.isTokenExpiredOrShouldBeRefreshed(tokenDetails)) { return retrieveUpdatedUsersTokenDetails(tokenDetails); } return tokenDetails; } @Autowired  UsersTokenService(OidcAuthenticationHelper oidcAuthenticationHelper,
                             OAuthClient oAuthClient); TokenDetails retrieveUsersTokenDetails(); }
UsersTokenService { public TokenDetails retrieveUsersTokenDetails() { TokenDetails tokenDetails = retrieveUsersTokenDetailsFromSecurityContext(); if (tokenDetails.isNotEmpty() && oidcAuthenticationHelper.isTokenExpiredOrShouldBeRefreshed(tokenDetails)) { return retrieveUpdatedUsersTokenDetails(tokenDetails); } return tokenDetails; } @Autowired  UsersTokenService(OidcAuthenticationHelper oidcAuthenticationHelper,
                             OAuthClient oAuthClient); TokenDetails retrieveUsersTokenDetails();  }