use of org.wso2.carbon.apimgt.core.models.policy.JWTClaimsCondition in project carbon-apimgt by wso2.
the class CommonThrottleMappingUtilTestCase method fromJWTConditionDtoToJWTConditionModelTest.
@Test(description = "Convert JWT Condition DTO to JWTCondition Model object")
public void fromJWTConditionDtoToJWTConditionModelTest() throws Exception {
ThrottleConditionDTO throttleConditionDTO = new ThrottleConditionDTO();
throttleConditionDTO.setType(PolicyConstants.JWT_CLAIMS_CONDITION_TYPE);
JWTClaimsConditionDTO jwtClaimsConditionDTO = new JWTClaimsConditionDTO();
jwtClaimsConditionDTO.setAttribute("testAttribute");
jwtClaimsConditionDTO.setClaimUrl("http://wso2.org/claims");
throttleConditionDTO.setJwtClaimsCondition(jwtClaimsConditionDTO);
JWTClaimsCondition condition = (JWTClaimsCondition) CommonThrottleMappingUtil.fromDTOToCondition(throttleConditionDTO);
Assert.assertNotNull(condition);
assertEquals(condition.getAttribute(), "testAttribute");
assertEquals(condition.getClaimUrl(), "http://wso2.org/claims");
}
Aggregations