use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseTest.
/*
* @testName: constructorResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:306; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new bad client request exception. throws -
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 400.
*
* getResponse
*/
@Test
public void constructorResponseTest() throws Fault {
Response response = buildResponse();
BadRequestException e = new BadRequestException(response);
assertResponse(e, HOST);
}
use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowableThrowsExceptionTest.
/*
* @testName: constructorResponseThrowableThrowsExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:308;
*
* @test_Strategy: Construct a new bad client request exception. throws -
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 400.
*/
@Test
public void constructorResponseThrowableThrowsExceptionTest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
BadRequestException e = new BadRequestException(response, new Throwable());
fault("Exception has been not been thrown for response with status", status, "; exception", e);
} catch (IllegalArgumentException e) {
logMsg("IllegalArgumentException has been thrown for status", status, "as expected");
}
}
Aggregations