LocalTestServer Class
- java.
lang. Object - com.
azure. core. test. http. LocalTestServer
- com.
public class LocalTestServer
Local server that will reply to requests based on the configured HttpServlet.
Constructor Summary
Constructor | Description |
---|---|
LocalTestServer(LocalTestServer.RequestHandler requestHandler) |
Creates a new instance of LocalTestServer that will reply to requests based on the passed Request |
LocalTestServer(LocalTestServer.RequestHandler requestHandler, int maxThreads) |
Creates a new instance of LocalTestServer that will reply to requests based on the passed Request |
Method Summary
Modifier and Type | Method and Description |
---|---|
int |
getHttpPort()
Gets the HTTP port that the local server is listening on. |
String |
getHttpUri()
Gets the HTTP URI that the local server is listening on. |
int |
getHttpsPort()
Gets the HTTPS port that the local server is listening on. |
String |
getHttpsUri()
Gets the HTTPS URI that the local server is listening on. |
void |
start()
Starts the local server. |
void |
stop()
Stops the local server. |
Methods inherited from java.lang.Object
Constructor Details
LocalTestServer
public LocalTestServer(LocalTestServer.RequestHandler requestHandler)
Creates a new instance of LocalTestServer that will reply to requests based on the passed RequestHandler.
Parameters:
LocalTestServer
public LocalTestServer(LocalTestServer.RequestHandler requestHandler, int maxThreads)
Creates a new instance of LocalTestServer that will reply to requests based on the passed RequestHandler.
Parameters:
Method Details
getHttpPort
public int getHttpPort()
Gets the HTTP port that the local server is listening on.
Returns:
getHttpUri
public String getHttpUri()
Gets the HTTP URI that the local server is listening on.
Returns:
getHttpsPort
public int getHttpsPort()
Gets the HTTPS port that the local server is listening on.
Returns:
getHttpsUri
public String getHttpsUri()
Gets the HTTPS URI that the local server is listening on.
Returns:
start
public void start()
Starts the local server.
This must be called before any requests will be processed.
stop
public void stop()
Stops the local server.
This must be called to close any server resources.