use of com.linkedin.restli.examples.greetings.client.AsyncErrorsBuilders in project rest.li by linkedin.
the class TestAsyncExceptions method testCallback.
@Test(dataProvider = "exceptionProvider")
public void testCallback(String key, int expectedStatus) throws RemoteInvocationException {
AsyncErrorsBuilders builder = new AsyncErrorsBuilders();
Request<Greeting> request = builder.actionCallback().paramId(key).build();
try {
getClient().sendRequest(request).getResponse();
Assert.fail("This request should have failed.");
} catch (RestLiResponseException e) {
Assert.assertEquals(e.getStatus(), expectedStatus);
}
}
use of com.linkedin.restli.examples.greetings.client.AsyncErrorsBuilders in project rest.li by linkedin.
the class TestAsyncExceptions method testTask.
@Test(dataProvider = "exceptionProvider")
public void testTask(String key, int expectedStatus) throws RemoteInvocationException {
AsyncErrorsBuilders builder = new AsyncErrorsBuilders();
Request<Greeting> request = builder.actionTask().paramId(key).build();
try {
getClient().sendRequest(request).getResponse();
Assert.fail("This request should have failed.");
} catch (RestLiResponseException e) {
Assert.assertEquals(e.getStatus(), expectedStatus);
}
}
use of com.linkedin.restli.examples.greetings.client.AsyncErrorsBuilders in project rest.li by linkedin.
the class TestAsyncExceptions method testPromise.
@Test(dataProvider = "exceptionProvider")
public void testPromise(String key, int expectedStatus) throws RemoteInvocationException {
AsyncErrorsBuilders builder = new AsyncErrorsBuilders();
Request<Greeting> request = builder.actionPromise().paramId(key).build();
try {
getClient().sendRequest(request).getResponse();
Assert.fail("This request should have failed.");
} catch (RestLiResponseException e) {
Assert.assertEquals(e.getStatus(), expectedStatus);
}
}
Aggregations