Class MockServer

java.lang.Object
com.intuit.karate.core.MockServer

@Deprecated(since="2.0", forRemoval=true) public class MockServer extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use MockServer instead. This class will be removed in a future release.
V1 compatibility shim for MockServer.

This class provides backward compatibility for code written against Karate v1. Migrate to MockServer for new code.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use MockServer.Builder instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    featureString(String featureContent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the underlying v2 MockServer for gradual migration.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • feature

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

      @Deprecated(since="2.0", forRemoval=true) public static MockServer.Builder featureString(String featureContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a builder for a mock server from a feature string.
    • getPort

      @Deprecated(since="2.0", forRemoval=true) public int getPort()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the port the server is listening on.
    • isSsl

      @Deprecated(since="2.0", forRemoval=true) public boolean isSsl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check if the server is using SSL/TLS.
    • getUrl

      @Deprecated(since="2.0", forRemoval=true) public String getUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the base URL for the server.
    • stop

      @Deprecated(since="2.0", forRemoval=true) public void stop()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Stop the mock server and wait for shutdown to complete (blocking).

      V1 name was stop(); v2 uses stopAndWait().

    • stopAndWait

      @Deprecated(since="2.0", forRemoval=true) public void stopAndWait()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Stop the mock server and wait for shutdown to complete (blocking).
    • stopAsync

      @Deprecated(since="2.0", forRemoval=true) public void stopAsync()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Stop the mock server asynchronously (non-blocking).
    • waitSync

      @Deprecated(since="2.0", forRemoval=true) public void waitSync()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wait for the server to be stopped (blocking).
    • getVariable

      @Deprecated(since="2.0", forRemoval=true) public Object getVariable(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get a variable from the mock handler's global context.
    • toV2MockServer

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