use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithGenericTypeStringTest.
/*
* @testName: optionsWithGenericTypeStringTest
*
* @assertion_ids: JAXRS:JAVADOC:580;
*
* @test_Strategy: Invoke HTTP options method for the current request
* synchronously.
*/
@Test
public void optionsWithGenericTypeStringTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("options");
GenericType<String> generic = createGeneric(String.class);
String response = sync.options(generic);
assertResponseString(response, "options");
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithResponseClassWithEntityTest.
/*
* @testName: methodWithResponseClassWithEntityTest
*
* @assertion_ids: JAXRS:JAVADOC:569;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* synchronously.
*/
@Test
public void methodWithResponseClassWithEntityTest() throws Fault {
String response = null;
for (String method : ENTITY_METHODS) {
SyncInvoker sync = createSyncInvokerForMethod(method.toLowerCase());
Entity<String> entity = createEntity(method.toLowerCase());
response = sync.method(method, entity, String.class);
assertResponseString(response, method.toLowerCase());
}
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithResponseClassTest.
/*
* @testName: getWithResponseClassTest
*
* @assertion_ids: JAXRS:JAVADOC:551;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* synchronously.
*/
@Test
public void getWithResponseClassTest() throws Fault {
SyncInvoker sync = createSyncInvokerForMethod("get");
Response response = sync.get(Response.class);
assertResponseOk(response);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsThrowsProcessingExceptionTest.
/*
* @testName: optionsThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:575;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.options throws
* ProcessingException in case the invocation failed.
*/
@Test
public void optionsThrowsProcessingExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerWrongUrl();
sync.options();
}
};
assertProcessingException(run);
}
use of jakarta.ws.rs.client.SyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithGenericTypeStringThrowsWebApplicationExceptionTest.
/*
* @testName: getWithGenericTypeStringThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:554;
*
* @test_Strategy: jakarta.ws.rs.client.SyncInvoker.get( GenericType ) throws
* WebApplicationException - in case the response status code of the response
* returned by the server is not successful and the specified response type is
* not Response.
*/
@Test
public void getWithGenericTypeStringThrowsWebApplicationExceptionTest() throws Fault {
Runnable run = new Runnable() {
@Override
public void run() {
SyncInvoker sync = createSyncInvokerForMethod("getnotok");
GenericType<String> generic = createGeneric(String.class);
sync.get(generic);
}
};
assertWebApplicationException(run);
}
Aggregations