use of org.wso2.carbon.apimgt.api.model.APIRating in project carbon-apimgt by wso2.
the class APIConsumerImplTest method testRateAPI.
@Test
public void testRateAPI() throws APIManagementException {
String uuid = UUID.randomUUID().toString();
APIRating apiRating = APIRating.RATING_FOUR;
String user = "Tom";
APIConsumerImpl apiConsumer = new APIConsumerImplWrapper(apiMgtDAO);
Mockito.doNothing().when(apiMgtDAO).addRating(uuid, apiRating.getRating(), user);
apiConsumer.rateAPI(uuid, apiRating, user);
Mockito.verify(apiMgtDAO, Mockito.times(1)).addRating(uuid, apiRating.getRating(), user);
}
Aggregations