use of com.nimbusds.oauth2.sdk.token.RefreshToken in project pac4j by pac4j.
the class OidcProfileTests method testReadWriteObjectNullAccessToken.
/**
* Test that serialization and deserialization of the OidcProfile work when the BearerAccessToken is null.
*/
@Test
public void testReadWriteObjectNullAccessToken() {
OidcProfile profile = new OidcProfile();
profile.setIdTokenString(ID_TOKEN);
profile.setRefreshToken(new RefreshToken(REFRESH_TOKEN));
byte[] result = SerializationUtils.serialize(profile);
profile = SerializationUtils.deserialize(result);
assertNull(profile.getAccessToken());
assertEquals(profile.getIdTokenString(), ID_TOKEN);
assertEquals(profile.getRefreshToken().getValue(), REFRESH_TOKEN);
}
Aggregations