Class MockHttpTransport



  • @Beta
    public class MockHttpTransport
    extends HttpTransport
    Beta
    Mock for HttpTransport.

    Implementation is thread-safe. For maximum efficiency, applications should use a single globally-shared instance of the HTTP transport.

    Since:
    1.3
    • Constructor Detail

      • MockHttpTransport

        public MockHttpTransport()
      • MockHttpTransport

        protected MockHttpTransport(MockHttpTransport.Builder builder)
        Parameters:
        builder - builder
        Since:
        1.14
    • Method Detail

      • supportsMethod

        public boolean supportsMethod(String method)
                               throws IOException
        Description copied from class: HttpTransport
        Returns whether a specified HTTP method is supported by this transport.

        Default implementation returns true if and only if the request method is "DELETE", "GET", "POST", or "PUT". Subclasses should override.

        Overrides:
        supportsMethod in class  HttpTransport
        Parameters:
        method - HTTP method
        Throws:
        IOException - I/O exception
      • getSupportedMethods

        public final Set<String> getSupportedMethods()
        Returns the unmodifiable set of supported HTTP methods or null to specify that all methods are supported.
      • builder

        @Deprecated
        public static MockHttpTransport.Builder builder()
        Deprecated.  (to be removed in the future) Use Builder#Builder() instead.

        Returns an instance of a new builder.

        Since:
        1.5