assertEquals(ANOTHER_USER_ID, payload.getSubject());
assertEquals(ANOTHER_CLIENT_ID, payload.getAuthorizedParty());
}
public void testEmailVerified() {
Payload payload = newPayload(USER_ID, CLIENT_ID);
assertNull(payload.getEmailVerified());
payload.setEmailVerified(true);
assertTrue(payload.getEmailVerified());
payload.setEmailVerified(false);
assertFalse(payload.getEmailVerified());
payload.setEmailVerified(null);
assertNull(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, "true");
assertTrue(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, true);
assertTrue(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, "false");
assertFalse(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, false);
assertFalse(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, "RandomString");
assertFalse(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, "");
assertFalse(payload.getEmailVerified());
payload.set(EMAIL_VERIFIED_KEY, null);
assertNull(payload.getEmailVerified());
// Wrong type.
payload.set(EMAIL_VERIFIED_KEY, new Integer(5));
try {
payload.getEmailVerified();
fail();
} catch (ClassCastException e) {
// Expected.
}
}