Search in sources :

Example 16 with ClientErrorException

use of jakarta.ws.rs.ClientErrorException in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method constructorStatusNullThrowsExceptionTest.

/*
   * @testName: constructorStatusNullThrowsExceptionTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:310;
   * 
   * @test_Strategy: Construct a new client error exception.
   * java.lang.IllegalArgumentException - in case the status code is null or if
   * it is not from the Response.Status.Family.CLIENT_ERROR status code family.
   */
@Test
public void constructorStatusNullThrowsExceptionTest() throws Fault {
    try {
        ClientErrorException e = new ClientErrorException((Status) null);
        fault("IllegalArgumentException has not been thrown for null status; exception", e);
    } catch (IllegalArgumentException e) {
        logMsg("IllegalArgumentException has been thrown as expected for null status");
    }
}
Also used : ClientErrorException(jakarta.ws.rs.ClientErrorException) Test(org.junit.jupiter.api.Test)

Aggregations

ClientErrorException (jakarta.ws.rs.ClientErrorException)16 Test (org.junit.jupiter.api.Test)16 Status (jakarta.ws.rs.core.Response.Status)12 Response (jakarta.ws.rs.core.Response)4