Package play.test

Class WSTestClient

java.lang.Object
play.test.WSTestClient

public class WSTestClient extends Object
  • Constructor Details

    • WSTestClient

      public WSTestClient()
  • Method Details

    • newClient

      public static WSClient newClient(int port)
      Create a new WSClient for use in testing.

      This client holds on to resources such as connections and threads, and so must be closed after use.

      If the URL passed into the url method of this client is a host relative absolute path (that is, if it starts with /), then this client will make the request on localhost using the supplied port. This is particularly useful in test situations.

      Parameters:
      port - The port to use on localhost when relative URLs are requested.
      Returns:
      A running WS client.