Class MockServer.Builder

java.lang.Object
com.intuit.karate.core.MockServer.Builder
Enclosing class:
MockServer

@Deprecated(since="2.0", forRemoval=true) public static class MockServer.Builder extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use MockServer.Builder instead.
V1 compatibility Builder for MockServer.
  • Method Details

    • feature

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder feature(String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a feature file by path.
    • featureString

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder featureString(String featureContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a feature from inline string content.
    • port

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder port(int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the port to listen on. 0 = dynamic port.
    • arg

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder arg(Map<String,Object> args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set initial arguments (variables) for the mock using a map.
    • arg

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder arg(String key, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use arg(Map.of(key, value)) instead.
      Set a single argument (variable) for the mock.

      V1 had this single key-value variant; v2 only has Map variant.

    • pathPrefix

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder pathPrefix(String prefix)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a path prefix to strip from incoming requests.
    • ssl

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder ssl(boolean ssl)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Enable SSL/TLS.
    • certPath

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder certPath(String certPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the SSL certificate file path (PEM format).
    • keyPath

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder keyPath(String keyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the SSL private key file path (PEM format).
    • certFile

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder certFile(File certFile)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use certPath(String) instead.
      Set the SSL certificate file.

      V1 used File objects; v2 uses String paths.

    • keyFile

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder keyFile(File keyFile)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use keyPath(String) instead.
      Set the SSL private key file.

      V1 used File objects; v2 uses String paths.

    • http

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder http(int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use port(port) instead. SSL is disabled by default.
      Configure HTTP server on the specified port.

      V1 combined port setting with ssl=false; v2 separates these.

    • https

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder https(int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use ssl(true).port(port) instead.
      Configure HTTPS server on the specified port.

      V1 combined port setting with ssl=true; v2 separates these.

    • watch

      @Deprecated(since="2.0", forRemoval=true) public MockServer.Builder watch(boolean watch)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Enable watch mode for hot-reloading feature files.
    • start

      @Deprecated(since="2.0", forRemoval=true) public MockServer start()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Start the mock server.
    • build

      @Deprecated(since="2.0", forRemoval=true) public MockServer build()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use start() instead.
      Build and start the mock server.

      V1 name was build(); v2 uses start().

    • toV2Builder

      public MockServer.Builder toV2Builder()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the underlying v2 Builder for gradual migration.