assertNull(actual.getRefreshToken());
assertNull(actual.getExpirationTimeMilliseconds());
}
public void testStoreCredentials() throws Exception {
Credential expected = createCredential();
File file = createTempFile();
file.delete();
FileCredentialStore store = new FileCredentialStore(file, JSON_FACTORY);
store = new FileCredentialStore(file, JSON_FACTORY);
store.store(USER_ID, expected);
store = new FileCredentialStore(file, JSON_FACTORY);
Credential actual = createEmptyCredential();
boolean loaded = store.load(USER_ID, actual);
assertTrue(loaded);
assertEquals(ACCESS_TOKEN, actual.getAccessToken());
assertEquals(REFRESH_TOKEN, actual.getRefreshToken());
assertEquals(EXPIRES_IN, actual.getExpirationTimeMilliseconds().longValue());
}