Search in sources :

Example 1 with InternalServiceException

use of io.scalecube.services.exceptions.InternalServiceException in project scalecube by scalecube.

the class ServiceRemoteTest method test_remote_serviceA_calls_serviceB_with_timeout.

@Test
public void test_remote_serviceA_calls_serviceB_with_timeout() {
    // getting proxy from any node at any given time.
    CoarseGrainedServiceImpl another = new CoarseGrainedServiceImpl();
    // Create microservices instance cluster.
    Microservices ms = Microservices.builder().discovery(ServiceRemoteTest::serviceDiscovery).transport(RSocketServiceTransport::new).services(// add service a and b
    another).startAwait();
    // Get a proxy to the service api.
    CoarseGrainedService service = gateway.call().api(CoarseGrainedService.class);
    InternalServiceException exception = assertThrows(InternalServiceException.class, () -> Mono.from(service.callGreetingTimeout("joe")).block());
    assertTrue(exception.getMessage().contains("Did not observe any item or terminal signal"));
    System.out.println("done");
    ms.shutdown().then(Mono.delay(TIMEOUT2)).block();
}
Also used : CoarseGrainedServiceImpl(io.scalecube.services.sut.CoarseGrainedServiceImpl) RSocketServiceTransport(io.scalecube.services.transport.rsocket.RSocketServiceTransport) CoarseGrainedService(io.scalecube.services.sut.CoarseGrainedService) InternalServiceException(io.scalecube.services.exceptions.InternalServiceException) Test(org.junit.jupiter.api.Test)

Aggregations

InternalServiceException (io.scalecube.services.exceptions.InternalServiceException)1 CoarseGrainedService (io.scalecube.services.sut.CoarseGrainedService)1 CoarseGrainedServiceImpl (io.scalecube.services.sut.CoarseGrainedServiceImpl)1 RSocketServiceTransport (io.scalecube.services.transport.rsocket.RSocketServiceTransport)1 Test (org.junit.jupiter.api.Test)1