use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringThrowableTest.
/*
* @testName: constructorStringThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:1058;
*
* @test_Strategy: Construct a new bad client request exception.
*/
@Test
public void constructorStringThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable throwable : throwables) {
BadRequestException e = new BadRequestException(MESSAGE, throwable);
assertMessage(e);
assertCause(e, throwable);
assertResponse(e);
}
}
use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringRequestThrowableThrowsIAETest.
/*
* @testName: constructorStringRequestThrowableThrowsIAETest
*
* @assertion_ids: JAXRS:JAVADOC:1059;
*
* @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 constructorStringRequestThrowableThrowsIAETest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
BadRequestException e = new BadRequestException(MESSAGE, 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");
}
}
use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorThrowableTest.
/*
* @testName: constructorThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:307; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new bad client request exception. cause - the
* underlying cause of the exception.
*
* getResponse
*/
@Test
public void constructorThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable throwable : throwables) {
BadRequestException e = new BadRequestException(throwable);
assertResponse(e);
assertCause(e, throwable);
}
}
use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseThrowsIEATest.
/*
* @testName: constructorStringResponseThrowsIEATest
*
* @assertion_ids: JAXRS:JAVADOC:1057;
*
* @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 constructorStringResponseThrowsIEATest() throws Fault {
for (Status status : Status.values()) if (status != STATUS)
try {
Response response = Response.status(status).build();
BadRequestException e = new BadRequestException(MESSAGE, response);
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");
}
}
use of jakarta.ws.rs.BadRequestException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorTest.
/*
* @testName: constructorTest
*
* @assertion_ids: JAXRS:JAVADOC:305; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new bad client request exception.
*
* getResponse
*/
@Test
public void constructorTest() throws Fault {
BadRequestException e = new BadRequestException();
assertResponse(e);
}
Aggregations