public final class TestChannelWithCertificatesUtility functions for creating GRPC Channels that require certificates.
Static Methods
getChannelBuilderForTestHost(String host, int sslPort)
public static ManagedChannelBuilder<?> getChannelBuilderForTestHost(String host, int sslPort)Create a channel builder to a service running behind a default test host configuration.
| Name | Description |
| host | Stringname running the test host, typically localhost. |
| sslPort | intof the test host which must have HTTP2 enabled. |
| Type | Description |
| io.grpc.ManagedChannelBuilder<?> | a connected Channel |
getChannelBuilderForTestHost(String host, int sslPort, String certPath, String hostInCert)
public static ManagedChannelBuilder<?> getChannelBuilderForTestHost(String host, int sslPort, String certPath, String hostInCert)Create a channel builder to a service running behind the specified test host.
| Name | Description |
| host | Stringname running the test host, typically localhost. |
| sslPort | intof the test host which must have HTTP2 enabled. |
| certPath | Stringpath to the certificate file |
| hostInCert | Stringthe name of the test host within the certificate file |
| Type | Description |
| io.grpc.ManagedChannelBuilder<?> | a connected Channel |
getChannelForTestHost(String host, int sslPort)
public static ManagedChannel getChannelForTestHost(String host, int sslPort)Create a channel to a service running behind a default test host configuration.
| Name | Description |
| host | Stringname running the test host, typically localhost. |
| sslPort | intof the test host which must have HTTP2 enabled. |
| Type | Description |
| io.grpc.ManagedChannel | a connected Channel |
getChannelForTestHost(String host, int sslPort, String certPath, String hostInCert)
public static ManagedChannel getChannelForTestHost(String host, int sslPort, String certPath, String hostInCert)Create a channel to a service running behind the specified test host configuration.
| Name | Description |
| host | Stringname running the test host, typically localhost. |
| sslPort | intof the test host which must have HTTP2 enabled. |
| certPath | Stringpath to the certificate file |
| hostInCert | Stringthe name of the test host within the certificate file |
| Type | Description |
| io.grpc.ManagedChannel | a connected Channel |