use of org.forgerock.openam.cts.utils.JSONSerialisation in project OpenAM by OpenRock.
the class OAuthAdapterTest method shouldNotDeserialiseATokenWhichDoesntContainAMap.
@Test
public void shouldNotDeserialiseATokenWhichDoesntContainAMap() {
// Given
JSONSerialisation serialisation = new JSONSerialisation(new ObjectMapper());
OAuthAdapter adapter = generateOAuthAdapter();
Token token = new Token("", TokenType.OAUTH);
token.setBlob(serialisation.serialise("badger").getBytes());
// When
JsonValue fromToken = adapter.fromToken(token);
// Then
assertThat(fromToken).isNull();
}
Aggregations