use of org.forgerock.openam.core.rest.devices.OathDeviceSettings in project OpenAM by OpenRock.
the class JsonConversionUtilsTest method shouldPerformRoundTripWithOathDeviceSettingsObject.
@Test
public void shouldPerformRoundTripWithOathDeviceSettingsObject() throws IOException {
//Given
OathDeviceSettings object = getOathDeviceSettingsObject("secret", "Device Name", 1431999532, 1, true, -1);
//When
JsonValue jsonValue = JsonConversionUtils.toJsonValue(object);
OathDeviceSettings oathDeviceSettings = JsonConversionUtils.toOathDeviceSettingValue(jsonValue);
//Then
Assert.assertEquals(oathDeviceSettings, object, "Expected OathDeviceSettings objects to have same content.");
}
use of org.forgerock.openam.core.rest.devices.OathDeviceSettings in project OpenAM by OpenRock.
the class JsonConversionUtilsTest method getOathDeviceSettingsObject.
private OathDeviceSettings getOathDeviceSettingsObject(String sharedSecret, String deviceName, long lastLogin, int counter, boolean checksumDigit, int truncationOffset) {
OathDeviceSettings oathDeviceSettings = new OathDeviceSettings(sharedSecret, deviceName, lastLogin, counter);
oathDeviceSettings.setChecksumDigit(checksumDigit);
oathDeviceSettings.setTruncationOffset(truncationOffset);
return oathDeviceSettings;
}
Aggregations