public void testPlain()
throws Exception {
UserInfo claims = new UserInfo(new Subject("alice"));
claims.setName("Alice Adams");
claims.setEmail(new InternetAddress("alice@wonderland.net"));
claims.setEmailVerified(true);
UserInfoSuccessResponse response = new UserInfoSuccessResponse(claims);
assertEquals(claims, response.getUserInfo());
assertEquals("application/json; charset=UTF-8", response.getContentType().toString());
assertNull(response.getUserInfoJWT());
HTTPResponse httpResponse = response.toHTTPResponse();
response = UserInfoSuccessResponse.parse(httpResponse);
assertEquals("application/json; charset=UTF-8", response.getContentType().toString());
assertNull(response.getUserInfoJWT());
claims = response.getUserInfo();
assertEquals("alice", claims.getSubject().getValue());
assertEquals("Alice Adams", claims.getName());
assertEquals("alice@wonderland.net", claims.getEmail().toString());
assertTrue(claims.getEmailVerified());
}