use of net.morimekta.test.providence.client.Failure in project providence by morimekta.
the class HttpClientHandlerTest method testSimpleRequest_exception.
@Test
public void testSimpleRequest_exception() throws IOException, Failure, TException {
TestService.Iface client = new TestService.Client(new HttpClientHandler(this::endpoint, factory(), provider, instrumentation));
when(impl.test(any(net.morimekta.test.thrift.client.Request.class))).thenThrow(new net.morimekta.test.thrift.client.Failure("failure"));
try {
client.test(new Request("request"));
fail("No exception");
} catch (Failure ex) {
assertThat(ex.getText(), is("failure"));
}
verify(impl).test(any(net.morimekta.test.thrift.client.Request.class));
verify(instrumentation).onComplete(anyDouble(), any(PServiceCall.class), any(PServiceCall.class));
verifyNoMoreInteractions(impl, instrumentation);
}
Aggregations