use of io.gravitee.management.model.UpdateTopApiEntity in project gravitee-management-rest-api by gravitee-io.
the class TopApiServiceTest method shouldNotUpdate.
@Test(expected = IllegalArgumentException.class)
public void shouldNotUpdate() {
final UpdateTopApiEntity topApi = new UpdateTopApiEntity();
topApi.setApi("api");
topApi.setOrder(2);
final UpdateTopApiEntity topApi2 = new UpdateTopApiEntity();
topApi2.setApi("api2");
topApi.setOrder(1);
when(parameterService.findAll(PORTAL_TOP_APIS.getKey())).thenReturn(singletonList("api"));
topApiService.update(asList(topApi, topApi2));
}
use of io.gravitee.management.model.UpdateTopApiEntity in project gravitee-management-rest-api by gravitee-io.
the class TopApiServiceTest method shouldUpdate.
@Test
public void shouldUpdate() {
final UpdateTopApiEntity topApi = new UpdateTopApiEntity();
topApi.setApi("api");
topApi.setOrder(2);
final UpdateTopApiEntity topApi2 = new UpdateTopApiEntity();
topApi2.setApi("api2");
topApi.setOrder(1);
when(parameterService.findAll(PORTAL_TOP_APIS.getKey())).thenReturn(asList("api", "api2"));
topApiService.update(asList(topApi, topApi2));
verify(parameterService).updateMultipleValue(PORTAL_TOP_APIS.getKey(), asList("api2", "api"));
verify(parameterService).findAll(eq(PORTAL_TOP_APIS.getKey()), any(), any());
}
Aggregations