use of io.servicetalk.grpc.netty.TesterProto.Tester.TesterService in project servicetalk by apple.
the class ErrorHandlingTest method setupForServiceEmitsError.
private ServiceFactory setupForServiceEmitsError(final Throwable toThrow) {
final TesterService service = mockTesterService();
setupForServiceEmitsError(service, toThrow);
return new ServiceFactory(service);
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.TesterService in project servicetalk by apple.
the class ClosureTest method serviceImplIsClosed.
@ParameterizedTest(name = "graceful? => {0}")
@ValueSource(booleans = { true, false })
void serviceImplIsClosed(final boolean param) throws Exception {
setUp(param);
CloseSignal signal = new CloseSignal(1);
TesterService svc = setupCloseMock(mock(TesterService.class), signal);
startServerAndClose(new ServiceFactory(svc), signal);
verifyClosure(svc, 4);
signal.verifyCloseAtLeastCount(closeGracefully);
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.TesterService in project servicetalk by apple.
the class ErrorHandlingTest method setupForServiceOperatorThrows.
private ServiceFactory setupForServiceOperatorThrows(final Throwable toThrow) {
final TesterService service = mockTesterService();
setupForServiceOperatorThrows(service, toThrow);
return new ServiceFactory(service);
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.TesterService in project servicetalk by apple.
the class ErrorHandlingTest method mockTesterService.
private TesterService mockTesterService() {
TesterService filter = mock(TesterService.class);
when(filter.closeAsync()).thenReturn(completed());
when(filter.closeAsyncGracefully()).thenReturn(completed());
return filter;
}
use of io.servicetalk.grpc.netty.TesterProto.Tester.TesterService in project servicetalk by apple.
the class GrpcRouterConfigurationTest method testCanNotOverrideAlreadyRegisteredPathWithAnotherStrategy.
@Test
void testCanNotOverrideAlreadyRegisteredPathWithAnotherStrategy() {
final TesterService asyncService = DEFAULT_STRATEGY_ASYNC_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(TestRpc.PATH, builder -> builder.test(asyncService).test(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestBiDiStreamRpc.PATH, builder -> builder.testBiDiStream(asyncService).testBiDiStream(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestResponseStreamRpc.PATH, builder -> builder.testResponseStream(asyncService).testResponseStream(offloadNever(), asyncService));
testCanNotOverrideAlreadyRegisteredPath(TestRequestStreamRpc.PATH, builder -> builder.testRequestStream(asyncService).testRequestStream(offloadNever(), asyncService));
final BlockingTesterService blockingService = DEFAULT_STRATEGY_BLOCKING_SERVICE;
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRpc.PATH, builder -> builder.testBlocking(blockingService).testBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestBiDiStreamRpc.PATH, builder -> builder.testBiDiStreamBlocking(blockingService).testBiDiStreamBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestResponseStreamRpc.PATH, builder -> builder.testResponseStreamBlocking(blockingService).testResponseStreamBlocking(offloadNever(), blockingService));
testCanNotOverrideAlreadyRegisteredPath(BlockingTestRequestStreamRpc.PATH, builder -> builder.testRequestStreamBlocking(blockingService).testRequestStreamBlocking(offloadNever(), blockingService));
}
Aggregations