ProfilerServiceProxy extends ServiceProxy { @Override public ServerServiceDefinition getServiceDefinition() { return generatePassThroughDefinitions(Collections.emptyMap(), myServiceStub); } ProfilerServiceProxy(@NotNull ManagedChannel channel); @Override ServerServiceDefinition getServiceDefinition();  }
@Test public void testBindServiceContainsAllMethods() { ManagedChannel channel = InProcessChannelBuilder.forName("testBindServiceContainsAllMethods").build(); ProfilerServiceProxy proxy = new ProfilerServiceProxy(channel); ServerServiceDefinition serverDefinition = proxy.getServiceDefinition(); Collection<MethodDescriptor<?, ?>> allMethods = ProfilerServiceGrpc.getServiceDescriptor().getMethods(); Set<MethodDescriptor<?, ?>> definedMethods = serverDefinition.getMethods().stream().map(method -> method.getMethodDescriptor()).collect(Collectors.toSet()); assertThat(definedMethods.size()).isEqualTo(allMethods.size()); definedMethods.containsAll(allMethods); }