use of io.scalecube.services.ServiceCall in project scalecube by scalecube.
the class TestStreamingService method test_unknown_method.
@Test
public void test_unknown_method() throws InterruptedException {
Microservices gateway = Microservices.builder().build();
Microservices node = Microservices.builder().seeds(gateway.cluster().address()).services(new SimpleQuoteService()).build();
ServiceCall service = gateway.dispatcher().create();
final CountDownLatch latch1 = new CountDownLatch(1);
Message scheduled = Messages.builder().request(QuoteService.NAME, "unknonwn").build();
try {
service.listen(scheduled);
} catch (Exception ex) {
if (ex.getMessage().contains("No reachable member with such service: unknonwn")) {
latch1.countDown();
}
}
latch1.await(2, TimeUnit.SECONDS);
assertTrue(latch1.getCount() == 0);
node.shutdown();
gateway.shutdown();
}
Aggregations