Class TestUtils

  • @ExperimentalApi("")
    public class TestUtils
    extends Object
    Common utility functions useful for writing tests.
    • Method Detail

      • recordRequestHeadersInterceptor

        public static ServerInterceptor recordRequestHeadersInterceptor​(AtomicReference<Metadata> headersCapture)
        Capture the request headers from a client. Useful for testing metadata propagation.
      • preferredTestCiphers

        public static List<String> preferredTestCiphers()
        Not for public use
        Returns 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.
      • newSslSocketFactoryForCa

        public static SSLSocketFactory newSslSocketFactoryForCa​(Provider provider,
                                                                File certChainFile)
                                                         throws Exception
        Not for public use
        Creates an SSLSocketFactory which contains certChainFile as its only root certificate.