### Question:
RefreshableKeycloakSecurityContext extends KeycloakSecurityContext { public boolean isActive() { return token != null && this.token.isActive() && deployment!=null && this.token.getIssuedAt() >= deployment.getNotBefore(); } RefreshableKeycloakSecurityContext();  RefreshableKeycloakSecurityContext(KeycloakDeployment deployment, AdapterTokenStore tokenStore, String tokenString, AccessToken token, String idTokenString, IDToken idToken, String refreshToken); @Override AccessToken getToken(); @Override String getTokenString(); @Override IDToken getIdToken(); @Override String getIdTokenString(); String getRefreshToken(); void logout(KeycloakDeployment deployment); boolean isActive(); boolean isTokenTimeToLiveSufficient(AccessToken token); KeycloakDeployment getDeployment(); void setCurrentRequestInfo(KeycloakDeployment deployment, AdapterTokenStore tokenStore); boolean refreshExpiredToken(boolean checkActive); void setAuthorizationContext(AuthorizationContext authorizationContext);  }### Answer:
@Test public void isActive() { TokenMetadataRepresentation token = new TokenMetadataRepresentation(); token.setActive(true); token.issuedNow(); RefreshableKeycloakSecurityContext sut = new RefreshableKeycloakSecurityContext(null,null,null,token,null, null, null); assertFalse(sut.isActive()); }
@Test public void sameIssuedAtAsNotBeforeIsActiveKEYCLOAK10013() { KeycloakDeployment keycloakDeployment = new KeycloakDeployment(); keycloakDeployment.setNotBefore(5000); TokenMetadataRepresentation token = new TokenMetadataRepresentation(); token.setActive(true); token.issuedAt(4999); RefreshableKeycloakSecurityContext sut = new RefreshableKeycloakSecurityContext(keycloakDeployment,null,null,token,null, null, null); assertFalse(sut.isActive()); token.issuedAt(5000); assertTrue(sut.isActive()); }