Search in sources :

Example 6 with OAuthTokenField

use of org.forgerock.openam.cts.api.fields.OAuthTokenField in project OpenAM by OpenRock.

the class OAuthAdapterTest method shouldNotAllowASingleDate.

@Test(expectedExceptions = IllegalStateException.class)
public void shouldNotAllowASingleDate() {
    // Given
    OAuthAdapter adapter = generateOAuthAdapter();
    String text = "1234567890";
    OAuthTokenField field = OAuthTokenField.EXPIRY_TIME;
    Map<String, Object> values = new HashMap<String, Object>();
    values.put(field.getOAuthField(), text);
    JsonValue jsonValue = makeDefaultJsonValue(values);
    // When
    adapter.toToken(jsonValue);
}
Also used : OAuthTokenField(org.forgerock.openam.cts.api.fields.OAuthTokenField) HashMap(java.util.HashMap) JsonValue(org.forgerock.json.JsonValue) Test(org.testng.annotations.Test)

Aggregations

OAuthTokenField (org.forgerock.openam.cts.api.fields.OAuthTokenField)6 HashMap (java.util.HashMap)5 JsonValue (org.forgerock.json.JsonValue)5 Test (org.testng.annotations.Test)5 Token (org.forgerock.openam.cts.api.tokens.Token)3 HashSet (java.util.HashSet)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Collection (java.util.Collection)1 Set (java.util.Set)1 JSONSerialisation (org.forgerock.openam.cts.utils.JSONSerialisation)1