@Test public void testClear() throws Exception { credentialStore.init(accessToken, refreshToken, expiresIn, acquisitionTime, CredentialStore.AUTHENTICATED); credentialStore.clear(); assertEquals(credentialStore.getAuthStatus(), CredentialStore.NOT_AUTHENTICATED); assertEquals(credentialStore.getExpiresIn(), -1); assertNull(credentialStore.getAccessToken()); assertNull(credentialStore.getRefreshToken()); }
synchronized void clear() { this.accessToken = null; this.refreshToken = null; this.expiresIn = -1; this.tokenAcquisitionTime = new Date(0); this.authStatus = NOT_AUTHENTICATED; persister.persistUser(this); }
CredentialStore { synchronized void clear() { this.accessToken = null; this.refreshToken = null; this.expiresIn = -1; this.tokenAcquisitionTime = new Date(0); this.authStatus = NOT_AUTHENTICATED; persister.persistUser(this); } }
CredentialStore { synchronized void clear() { this.accessToken = null; this.refreshToken = null; this.expiresIn = -1; this.tokenAcquisitionTime = new Date(0); this.authStatus = NOT_AUTHENTICATED; persister.persistUser(this); } CredentialStore(CredentialPersister persister); }
CredentialStore { synchronized void clear() { this.accessToken = null; this.refreshToken = null; this.expiresIn = -1; this.tokenAcquisitionTime = new Date(0); this.authStatus = NOT_AUTHENTICATED; persister.persistUser(this); } CredentialStore(CredentialPersister persister); void init(String accessToken, String refreshToken, int expiresIn, Date tokenAcquisitionTime, @AuthStatus int authStatus); String getAccessToken(); String getRefreshToken(); int getExpiresIn(); Date getTokenAcquisitionTime(); }
CredentialStore { synchronized void clear() { this.accessToken = null; this.refreshToken = null; this.expiresIn = -1; this.tokenAcquisitionTime = new Date(0); this.authStatus = NOT_AUTHENTICATED; persister.persistUser(this); } CredentialStore(CredentialPersister persister); void init(String accessToken, String refreshToken, int expiresIn, Date tokenAcquisitionTime, @AuthStatus int authStatus); String getAccessToken(); String getRefreshToken(); int getExpiresIn(); Date getTokenAcquisitionTime(); final static int NOT_AUTHENTICATED; final static int TOKEN_EXPIRED; final static int AUTHENTICATED; }