use of org.wso2.carbon.apimgt.core.models.RegistrationSummary in project carbon-apimgt by wso2.
the class MappingUtil method toJWTInfoDTO.
/**
* Converts RegistrationSummary JWT information into JWTInfoDTO
*
* @param registrationSummary the registration summary required by gateway
* @return JWTInfoDTO
*/
private static JWTInfoDTO toJWTInfoDTO(RegistrationSummary registrationSummary) {
JWTInfoDTO jwtInfoDTO = new JWTInfoDTO();
jwtInfoDTO.enableJWTGeneration(registrationSummary.getJwtInfo().isEnableJWTGeneration());
jwtInfoDTO.jwtHeader(registrationSummary.getJwtInfo().getJwtHeader());
return jwtInfoDTO;
}
use of org.wso2.carbon.apimgt.core.models.RegistrationSummary in project carbon-apimgt by wso2.
the class MappingUtil method toRegistrationSummaryDTO.
/**
* Converts the Gateway registration summary into RegistrationSummaryDTO
*
* @param registrationSummary the registration summary required by gateway
* @return RegistrationSummaryDTO
*/
public static RegistrationSummaryDTO toRegistrationSummaryDTO(RegistrationSummary registrationSummary) {
RegistrationSummaryDTO registrationSummaryDTO = new RegistrationSummaryDTO();
registrationSummaryDTO.setKeyManagerInfo(toKeyManagerInfoDTO(registrationSummary));
registrationSummaryDTO.setAnalyticsInfo(toAnalyticsDTO(registrationSummary));
registrationSummaryDTO.setJwTInfo(toJWTInfoDTO(registrationSummary));
registrationSummaryDTO.setThrottlingInfo(toThrottlingInfoDTO(registrationSummary));
registrationSummaryDTO.setGoogleAnalyticsTrackingInfo(toGoogleAnalyticsTrackingInfoDTO(registrationSummary.getGoogleAnalyticsTrackingInfo()));
return registrationSummaryDTO;
}
use of org.wso2.carbon.apimgt.core.models.RegistrationSummary in project carbon-apimgt by wso2.
the class MappingUtilTestCase method toRegistrationSummaryDTOTest.
@Test
public void toRegistrationSummaryDTOTest() {
RegistrationSummary registrationSummary = SampleTestObjectCreator.createUniqueRegistrationSummary();
RegistrationSummaryDTO registrationSummaryDTO = MappingUtil.toRegistrationSummaryDTO(registrationSummary);
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getCredentials().getPassword(), registrationSummaryDTO.getKeyManagerInfo().getCredentials().getPassword());
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getCredentials().getUsername(), registrationSummaryDTO.getKeyManagerInfo().getCredentials().getUsername());
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getDcrEndpoint(), registrationSummaryDTO.getKeyManagerInfo().getDcrEndpoint());
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getIntrospectEndpoint(), registrationSummaryDTO.getKeyManagerInfo().getIntrospectEndpoint());
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getRevokeEndpoint(), registrationSummaryDTO.getKeyManagerInfo().getRevokeEndpoint());
Assert.assertEquals(registrationSummary.getKeyManagerInfo().getTokenEndpoint(), registrationSummaryDTO.getKeyManagerInfo().getTokenEndpoint());
Assert.assertEquals(registrationSummary.getAnalyticsInfo().getDasServerCredentials().getUsername(), registrationSummaryDTO.getAnalyticsInfo().getCredentials().getUsername());
Assert.assertEquals(registrationSummary.getAnalyticsInfo().getDasServerCredentials().getPassword(), registrationSummaryDTO.getAnalyticsInfo().getCredentials().getPassword());
Assert.assertEquals(registrationSummary.getAnalyticsInfo().getDasServerURL(), registrationSummaryDTO.getAnalyticsInfo().getServerURL());
Assert.assertEquals(Boolean.valueOf(registrationSummary.getAnalyticsInfo().isEnabled()), Boolean.valueOf(registrationSummaryDTO.getAnalyticsInfo().getEnabled()));
Assert.assertEquals(registrationSummary.getJwtInfo().getJwtHeader(), registrationSummaryDTO.getJwTInfo().getJwtHeader());
Assert.assertEquals(Boolean.valueOf(registrationSummary.getJwtInfo().isEnableJWTGeneration()), Boolean.valueOf(registrationSummaryDTO.getJwTInfo().getEnableJWTGeneration()));
Assert.assertEquals(registrationSummary.getThrottlingInfo().getDataPublisher().getReceiverURL(), registrationSummaryDTO.getThrottlingInfo().getServerURL());
Assert.assertEquals(registrationSummary.getThrottlingInfo().getDataPublisher().getCredentials().getPassword(), registrationSummaryDTO.getThrottlingInfo().getCredentials().getPassword());
Assert.assertEquals(registrationSummary.getThrottlingInfo().getDataPublisher().getCredentials().getUsername(), registrationSummaryDTO.getThrottlingInfo().getCredentials().getUsername());
}
Aggregations