List of usage examples for org.springframework.security.oauth2.common OAuth2AccessToken equals
public boolean equals(Object obj)
From source file:org.apigw.authserver.svc.impl.TokenServicesImplTest.java
@Test @DirtiesContext/*from www. j av a2s . co m*/ public void testOneAccessTokenPerAuthentication() throws Exception { OAuth2Authentication authentication = new OAuth2Authentication( createAuthorizationRequest(CLIENT, Collections.singleton(READ_SCOPE)), new TestAuthentication(false)); OAuth2AccessToken first = services.createAccessToken(authentication); assertEquals(1, authorizationGrantRepository.count()); OAuth2AccessToken second = services.createAccessToken(authentication); assertFalse(first.equals(second)); assertEquals(1, authorizationGrantRepository.count()); }