use of io.servicetalk.grpc.api.GrpcStatusCode.UNIMPLEMENTED in project servicetalk by apple.
the class TrailersOnlyErrorTest method testRouteThrows.
@Test
void testRouteThrows() throws Exception {
final BlockingQueue<Throwable> asyncErrors = new LinkedBlockingDeque<>();
try (ServerContext serverContext = GrpcServers.forAddress(localAddress(0)).listenAndAwait(new Tester.ServiceFactory(mockTesterService()))) {
final GrpcClientBuilder<HostAndPort, InetSocketAddress> clientBuilder = GrpcClients.forAddress(serverHostAndPort(serverContext)).initializeHttp(builder -> builder.appendClientFilter(__ -> true, setupResponseVerifierFilter(asyncErrors)));
// thus no route is found and it should result in UNIMPLEMENTED.
try (GreeterClient client = clientBuilder.build(new Greeter.ClientFactory())) {
verifyException(client.sayHello(HelloRequest.newBuilder().build()).toFuture(), UNIMPLEMENTED);
assertNoAsyncErrors(asyncErrors);
}
}
}
Aggregations