static void withStub(final Duration shutdownGracePeriod,
            final ThrowingConsumer<TestServiceFutureStub> executuable) {

        final GrpcChannelsProperties properties = new GrpcChannelsProperties();
        properties.getGlobalChannel().setShutdownGracePeriod(shutdownGracePeriod);
        try (final GrpcChannelFactory factory = new InProcessChannelFactory(properties,
                new GlobalClientInterceptorRegistry(applicationContext))) {

            final Channel channel = factory.createChannel("test");
            final TestServiceFutureStub stub = TestServiceGrpc.newFutureStub(channel);
            assertDoesNotThrow(() -> executuable.accept(stub));
        }
    }
Tests for {@link InProcessChannelFactory}'s shutdown behavior using an in-process server/channel.
tests/src/test/java/net/devh/boot/grpc/test/shutdown/GrpcChannelLifecycleWithCallsTest.java