@@ -0,0 +1,3392 @@
+package net.spals.appbuilder.app.grpc;%0A%0Aimport com.google.inject.Guice;%0Aimport com.google.inject.Module;%0Aimport io.grpc.*;%0Aimport net.spals.appbuilder.graph.model.ServiceGraph;%0Aimport org.testng.annotations.Test;%0A%0Aimport static org.mockito.ArgumentMatchers.same;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * Unit tests for %7B@link GrpcWebServerModule%7D%0A *%0A * @author tkral%0A */%0Apublic class GrpcWebServerModuleTest %7B%0A%0A    @Test%0A    public void testCompressorRegistry() %7B%0A        final CompressorRegistry compressorRegistry = CompressorRegistry.newEmptyInstance();%0A        final ServerBuilder%3C?%3E grpcExternalServerBuilder = mock(ServerBuilder.class);%0A%0A        final Module compressorRegistryModule = binder -%3E%0A            binder.bind(CompressorRegistry.class).toInstance(compressorRegistry);%0A        Guice.createInjector(%0A            createWebServerModule(%22testCompressorRegistry%22, grpcExternalServerBuilder),%0A            compressorRegistryModule%0A        );%0A%0A        verify(grpcExternalServerBuilder).compressorRegistry(same(compressorRegistry));%0A    %7D%0A%0A    @Test%0A    public void testDecompressorRegistry() %7B%0A        final DecompressorRegistry decompressorRegistry = DecompressorRegistry.emptyInstance();%0A        final ServerBuilder%3C?%3E grpcExternalServerBuilder = mock(ServerBuilder.class);%0A%0A        final Module decompressorRegistryModule = binder -%3E%0A            binder.bind(DecompressorRegistry.class).toInstance(decompressorRegistry);%0A        Guice.createInjector(%0A            createWebServerModule(%22testDecompressorRegistry%22, grpcExternalServerBuilder),%0A            decompressorRegistryModule%0A        );%0A%0A        verify(grpcExternalServerBuilder).decompressorRegistry(same(decompressorRegistry));%0A    %7D%0A%0A    @Test%0A    public void testHandlerRegistry() %7B%0A        final HandlerRegistry handlerRegistry = mock(HandlerRegistry.class);%0A        final ServerBuilder%3C?%3E grpcExternalServerBuilder = mock(ServerBuilder.class);%0A%0A        final Module handlerRegistryModule = binder -%3E%0A            binder.bind(HandlerRegistry.class).toInstance(handlerRegistry);%0A        Guice.createInjector(%0A            createWebServerModule(%22testHandlerRegistry%22, grpcExternalServerBuilder),%0A            handlerRegistryModule%0A        );%0A%0A        verify(grpcExternalServerBuilder).fallbackHandlerRegistry(same(handlerRegistry));%0A    %7D%0A%0A    @Test%0A    public void testServerTransportFilter() %7B%0A        final ServerTransportFilter serverTransportFilter = mock(ServerTransportFilter.class);%0A        final ServerBuilder%3C?%3E grpcExternalServerBuilder = mock(ServerBuilder.class);%0A%0A        final Module serverTransportFilterModule = binder -%3E%0A            binder.bind(ServerTransportFilter.class).toInstance(serverTransportFilter);%0A        Guice.createInjector(%0A            createWebServerModule(%22testServerTransportFilter%22, grpcExternalServerBuilder),%0A            serverTransportFilterModule%0A        );%0A%0A        verify(grpcExternalServerBuilder).addTransportFilter(same(serverTransportFilter));%0A    %7D%0A%0A    private GrpcWebServerModule createWebServerModule(%0A        final String name,%0A        final ServerBuilder%3C?%3E grpcExternalServerBuilder%0A    ) %7B%0A        return new GrpcWebServerModule.Builder()%0A            .setApplicationName(name)%0A            .setServiceGraph(new ServiceGraph())%0A            .setGrpcExternalServerBuilder(grpcExternalServerBuilder)%0A            .build();%0A    %7D%0A%7D%0A

Add unit tests for GrpcWebServerModule