Package play.test

Class WSTestClient


  • public class WSTestClient
    extends Object
    • Constructor Detail

      • WSTestClient

        public WSTestClient()
    • Method Detail

      • 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.