use of jakarta.ws.rs.NotAuthorizedException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseThrowableTest.
/*
* @testName: constructorStringResponseThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:1086; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "not authorized" exception. getResponse
*/
@Test
public void constructorStringResponseThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
NotAuthorizedException e = new NotAuthorizedException(MESSAGE, buildResponse(STATUS), t);
assertResponse(e, HOST);
assertCause(e, t);
assertMessage(e);
}
}
use of jakarta.ws.rs.NotAuthorizedException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseTest.
/*
* @testName: constructorResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:336; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "not authorized" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 401.
*
* getResponse
*/
@Test
public void constructorResponseTest() throws Fault {
NotAuthorizedException e = new NotAuthorizedException(buildResponse(STATUS));
assertResponse(e, HOST);
}
use of jakarta.ws.rs.NotAuthorizedException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorObjectsThrowsNPEWhenNullTest.
/*
* @testName: constructorObjectsThrowsNPEWhenNullTest
*
* @assertion_ids: JAXRS:JAVADOC:335;
*
* @test_Strategy: Throws: java.lang.NullPointerException - in case the
* challenge parameter is null.
*/
@Test
public void constructorObjectsThrowsNPEWhenNullTest() throws Fault {
try {
NotAuthorizedException e = new NotAuthorizedException((Object) null, CHALLENGE[1], CHALLENGE[2]);
fault("NullPointerException has NOT been thrown as expected for null challenge; exception", e);
} catch (NullPointerException npe) {
logMsg("NullPointerException has been thrown as expected for null challenge");
}
}
use of jakarta.ws.rs.NotAuthorizedException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorResponseThrowableTest.
/*
* @testName: constructorResponseThrowableTest
*
* @assertion_ids: JAXRS:JAVADOC:338; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "not authorized" exception.
* java.lang.IllegalArgumentException - in case the status code set in the
* response is not HTTP 401. getResponse
*/
@Test
public void constructorResponseThrowableTest() throws Fault {
Throwable[] throwables = new Throwable[] { new RuntimeException(), new IOException(), new Error(), new Throwable() };
for (Throwable t : throwables) {
NotAuthorizedException e = new NotAuthorizedException(buildResponse(STATUS), t);
assertResponse(e, HOST);
assertCause(e, t);
}
}
use of jakarta.ws.rs.NotAuthorizedException in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method constructorStringResponseTest.
/*
* @testName: constructorStringResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:1084; JAXRS:JAVADOC:12;
*
* @test_Strategy: Construct a new "not authorized" exception.
*
* getResponse
*/
@Test
public void constructorStringResponseTest() throws Fault {
NotAuthorizedException e = new NotAuthorizedException(MESSAGE, buildResponse(STATUS));
assertResponse(e, HOST);
assertMessage(e);
}
Aggregations