Package io.grpc.testing
Class TestUtils
- java.lang.Object
-
- io.grpc.testing.TestUtils
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1791") public class TestUtils extends Object
Common utility functions useful for writing tests.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static X509Certificate
loadX509Cert(String fileName)
Deprecated.Not for public usestatic SSLSocketFactory
newSslSocketFactoryForCa(Provider provider, File certChainFile)
Deprecated.Not for public usestatic List<String>
preferredTestCiphers()
Deprecated.Not for public usestatic ServerInterceptor
recordRequestHeadersInterceptor(AtomicReference<Metadata> headersCapture)
Capture the request headers from a client.
-
-
-
Method Detail
-
recordRequestHeadersInterceptor
public static ServerInterceptor recordRequestHeadersInterceptor(AtomicReference<Metadata> headersCapture)
Capture the request headers from a client. Useful for testing metadata propagation.
-
preferredTestCiphers
@Deprecated public static List<String> preferredTestCiphers()
Deprecated.Not for public useReturns the ciphers preferred to use during tests. They may be chosen because they are widely available or because they are fast. There is no requirement that they provide confidentiality or integrity.
-
loadX509Cert
@Deprecated public static X509Certificate loadX509Cert(String fileName) throws CertificateException, IOException
Deprecated.Not for public useLoads an X.509 certificate from the classpath resources in src/main/resources/certs.- Parameters:
fileName
- name of a file in src/main/resources/certs.- Throws:
CertificateException
IOException
-
newSslSocketFactoryForCa
@Deprecated public static SSLSocketFactory newSslSocketFactoryForCa(Provider provider, File certChainFile) throws Exception
Deprecated.Not for public useCreates an SSLSocketFactory which containscertChainFile
as its only root certificate.- Throws:
Exception
-
-