Search in sources :

Example 1 with ErrorListResponse

use of com.redhat.service.bridge.infra.api.models.responses.ErrorListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ErrorsAPITest method testGetList.

@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
void testGetList() {
    ErrorListResponse response = given().contentType(ContentType.JSON).when().get(APIConstants.ERROR_API_BASE_PATH).as(ErrorListResponse.class);
    assertThat(exceptionClasses).hasSize((int) response.getTotal());
    assertThat(response.getItems().isEmpty()).isFalse();
    for (ErrorResponse item : response.getItems()) {
        assertThat(item).isEqualTo(given().contentType(ContentType.JSON).when().get(item.getHref()).as(ErrorResponse.class));
    }
}
Also used : ErrorListResponse(com.redhat.service.bridge.infra.api.models.responses.ErrorListResponse) ErrorResponse(com.redhat.service.bridge.infra.api.models.responses.ErrorResponse) TestSecurity(io.quarkus.test.security.TestSecurity) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

ErrorListResponse (com.redhat.service.bridge.infra.api.models.responses.ErrorListResponse)1 ErrorResponse (com.redhat.service.bridge.infra.api.models.responses.ErrorResponse)1 QuarkusTest (io.quarkus.test.junit.QuarkusTest)1 TestSecurity (io.quarkus.test.security.TestSecurity)1 Test (org.junit.jupiter.api.Test)1