Search in sources :

Example 1 with NewTopApiEntity

use of io.gravitee.management.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.getKey())).thenReturn(singletonList("api"));
    topApiService.create(topApi);
}
Also used : NewTopApiEntity(io.gravitee.management.model.NewTopApiEntity) Test(org.junit.Test)

Example 2 with NewTopApiEntity

use of io.gravitee.management.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).createMultipleValue(PORTAL_TOP_APIS.getKey(), "api");
    verify(parameterService).findAll(eq(PORTAL_TOP_APIS.getKey()), any(), any());
}
Also used : NewTopApiEntity(io.gravitee.management.model.NewTopApiEntity) Test(org.junit.Test)

Aggregations

NewTopApiEntity (io.gravitee.management.model.NewTopApiEntity)2 Test (org.junit.Test)2