@Test public void getAccessTokenScopes() { Set<String> scopes = new HashSet<>(); scopes.add("Scope1"); scopes.add("Scope2"); setToken(token, scopes); assertThat(SpringSecurityContext.getAccessToken().getScopes()).isEmpty(); assertThat(SpringSecurityContext.getAccessToken().hasLocalScope("Scope1")).isTrue(); assertThat(SpringSecurityContext.getAccessToken().hasLocalScope("Scope3")).isFalse(); }
@Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; }
SpringSecurityContext { @Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; } }
SpringSecurityContext { @Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; } private  SpringSecurityContext(); }
SpringSecurityContext { @Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; } private  SpringSecurityContext(); @Nullable static Token getToken(); @Nullable static AccessToken getAccessToken(); static void clear(); }
SpringSecurityContext { @Nullable public static AccessToken getAccessToken() { Token token = getToken(); return token instanceof AccessToken ? (AccessToken) token : null; } private  SpringSecurityContext(); @Nullable static Token getToken(); @Nullable static AccessToken getAccessToken(); static void clear();  }