use of io.gravitee.rest.api.model.NewTopApiEntity in project gravitee-management-rest-api by gravitee-io.
the class TopApiServiceTest method shouldNotCreate.
@Test(expected = IllegalArgumentException.class)
public void shouldNotCreate() {
final NewTopApiEntity topApi = new NewTopApiEntity();
topApi.setApi("api");
when(parameterService.findAll(PORTAL_TOP_APIS, ParameterReferenceType.ENVIRONMENT)).thenReturn(singletonList("api"));
topApiService.create(topApi);
}
use of io.gravitee.rest.api.model.NewTopApiEntity in project gravitee-management-rest-api by gravitee-io.
the class TopApiServiceTest method shouldCreate.
@Test
public void shouldCreate() {
final NewTopApiEntity topApi = new NewTopApiEntity();
topApi.setApi("api");
topApiService.create(topApi);
verify(parameterService).save(PORTAL_TOP_APIS, singletonList("api"), ParameterReferenceType.ENVIRONMENT);
verify(parameterService).findAll(eq(PORTAL_TOP_APIS), any(Function.class), any(Predicate.class), any(ParameterReferenceType.class));
}
Aggregations