@Test public void testChannelConfigurationWithSslConfig() { Resource certResource = mock(Resource.class); Resource keyResource = mock(Resource.class); Resource trustResource = mock(Resource.class); GrpcChannelDescriptor cfg = GrpcChannelDescriptor.builder() .sslDescriptor( GrpcTlsDescriptor.builder() .tlsCaCert(trustResource) .tlsCert(certResource) .tlsKey(keyResource) .build()) .build(); assertThat(cfg.host(), equalTo("localhost")); assertThat(cfg.port(), equalTo(1408)); Optional<GrpcTlsDescriptor> descriptor = cfg.tlsDescriptor(); assertThat(descriptor.isPresent(), is(true)); GrpcTlsDescriptor tlsDescriptor = descriptor.get(); assertThat(tlsDescriptor.isEnabled(), is(true)); assertThat(tlsDescriptor.tlsCaCert(), is(sameInstance(trustResource))); assertThat(tlsDescriptor.tlsCert(), is(sameInstance(certResource))); assertThat(tlsDescriptor.tlsKey(), is(sameInstance(keyResource))); }
public static GrpcChannelsProvider.Builder builder() { return builder(null); }
GrpcChannelsProvider { public static GrpcChannelsProvider.Builder builder() { return builder(null); } }
GrpcChannelsProvider { public static GrpcChannelsProvider.Builder builder() { return builder(null); } private  GrpcChannelsProvider(Map<String, GrpcChannelDescriptor> channelDescriptors); }
GrpcChannelsProvider { public static GrpcChannelsProvider.Builder builder() { return builder(null); } private  GrpcChannelsProvider(Map<String, GrpcChannelDescriptor> channelDescriptors); static GrpcChannelsProvider create(); static GrpcChannelsProvider create(Config config); static GrpcChannelsProvider.Builder builder(); static GrpcChannelsProvider.Builder builder(Config config); ManagedChannel channel(String name); }
GrpcChannelsProvider { public static GrpcChannelsProvider.Builder builder() { return builder(null); } private  GrpcChannelsProvider(Map<String, GrpcChannelDescriptor> channelDescriptors); static GrpcChannelsProvider create(); static GrpcChannelsProvider create(Config config); static GrpcChannelsProvider.Builder builder(); static GrpcChannelsProvider.Builder builder(Config config); ManagedChannel channel(String name); static final String DEFAULT_CHANNEL_NAME; static final String DEFAULT_HOST; static final String CFG_KEY_CHANNELS; static final int DEFAULT_PORT; }