use of org.wso2.carbon.identity.openidconnect.dao.RequestObjectDAOImpl in project identity-inbound-auth-oauth by wso2-extensions.
the class RequestObjectServiceTest method testGetRequestedClaimsForUserInfo.
@Test
public void testGetRequestedClaimsForUserInfo() throws Exception {
RequestObjectDAOImpl requestObjectDAO = new RequestObjectDAOImpl();
requestObjectService.addRequestObject(consumerKey, sessionKey, requestedEssentialClaims);
addToken(token, tokenId);
requestObjectDAO.updateRequestObjectReferencebyTokenId(sessionKey, tokenId);
List<RequestedClaim> claims = requestObjectService.getRequestedClaimsForUserInfo(token);
Assert.assertEquals(claims.get(0).getName(), "email");
}
use of org.wso2.carbon.identity.openidconnect.dao.RequestObjectDAOImpl in project identity-inbound-auth-oauth by wso2-extensions.
the class RequestObjectServiceTest method testGetRequestedClaimsForUserInfoException.
@Test(expectedExceptions = { IdentityOAuth2Exception.class })
public void testGetRequestedClaimsForUserInfoException() throws Exception {
RequestObjectDAOImpl requestObjectDAO = new RequestObjectDAOImpl();
requestObjectService.addRequestObject(consumerKey, sessionKey, requestedEssentialClaims);
requestObjectDAO.updateRequestObjectReferencebyTokenId(sessionKey, invalidTokenId);
addToken(token, tokenId);
List<RequestedClaim> claims = requestObjectService.getRequestedClaimsForUserInfo(token);
Assert.assertEquals(claims.get(0).getName(), "email");
}
use of org.wso2.carbon.identity.openidconnect.dao.RequestObjectDAOImpl in project identity-inbound-auth-oauth by wso2-extensions.
the class RequestObjectServiceTest method testGetRequestedClaimsForIDToken.
@Test
public void testGetRequestedClaimsForIDToken() throws Exception {
RequestObjectDAOImpl requestObjectDAO = new RequestObjectDAOImpl();
addToken(token, tokenId);
requestObjectService.addRequestObject(consumerKey, sessionKey, requestedEssentialClaims);
requestObjectDAO.updateRequestObjectReferencebyTokenId(sessionKey, tokenId);
List<RequestedClaim> claims = requestObjectService.getRequestedClaimsForIDToken(token);
Assert.assertEquals(claims.get(0).getName(), "address");
}
use of org.wso2.carbon.identity.openidconnect.dao.RequestObjectDAOImpl in project identity-inbound-auth-oauth by wso2-extensions.
the class RequestObjectDAOImplTest method setUp.
@BeforeClass
public void setUp() throws Exception {
requestObjectDAO = new RequestObjectDAOImpl();
requestedEssentialClaims = new ArrayList<>();
List lstRequestedClaims = new ArrayList<>();
List values = new ArrayList<>();
RequestedClaim requestedClaim = new RequestedClaim();
requestedClaim.setName("email");
requestedClaim.setType("userinfo");
requestedClaim.setValue("value1");
requestedClaim.setEssential(true);
requestedClaim.setValues(values);
values.add("val1");
values.add("val2");
requestedClaim.setValues(values);
lstRequestedClaims.add(requestedClaim);
requestedEssentialClaims.add(lstRequestedClaims);
}
Aggregations