use of io.gravitee.rest.api.portal.rest.model.Error in project gravitee-management-rest-api by gravitee-io.
the class ApplicationsResourceTest method shouldGetNoApplication.
@Test
public void shouldGetNoApplication() {
final Response response = target().queryParam("page", 10).queryParam("size", 1).request().get();
assertEquals(HttpStatusCode.BAD_REQUEST_400, response.getStatus());
ErrorResponse errorResponse = response.readEntity(ErrorResponse.class);
List<Error> errors = errorResponse.getErrors();
assertNotNull(errors);
assertEquals(1, errors.size());
Error error = errors.get(0);
assertEquals("errors.pagination.invalid", error.getCode());
assertEquals("400", error.getStatus());
assertEquals("Pagination is not valid", error.getMessage());
}
Aggregations