public class MockWebServer extends Object
| Constructor and Description |
|---|
MockWebServer()
Create an instance of an embedded Tomcat server, using a random port.
|
MockWebServer(int port)
Create an instance of an embedded Tomcat server, using a specified port.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPort()
Return the server port.
|
InputStream |
request(String resourcePath)
Request a resource from the server.
|
void |
start()
Start the Tomcat server.
|
void |
stop()
Stop the Tomcat server.
|
public MockWebServer()
throws Exception
Exception - Unspecified exception.public void start()
throws Exception
Exception - Unspecified exception.public void stop()
throws Exception
Exception - Unspecified exception.public int getPort()
public InputStream request(String resourcePath) throws Exception
resourcePath - Relative path of the resource.Exception - Unspecified exception.Copyright © 2023 Fujion Framework. All rights reserved.