public class WireMockHelper
extends com.adaptris.tester.runtime.helpers.Helper
WireMock (http://wiremock.org/):
WireMock is a simulator for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server.
It enables you to stay productive when an API you depend on doesn't exist or isn't complete. It supports testing of edge cases and failure modes that the real API won't reliably produce. And because it's fast it can reduce your build time from hours down to minutes.
In the service test configuration this class is aliased as wire-mock-helper which is the preferred alternative to the fully qualified classname when building your configuration.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
WIRE_MOCK_HELPER_PORT_PROPERTY_NAME
Key for helper property ("wire.mock.helper.port").
|
| Constructor and Description |
|---|
WireMockHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes WireMock server and release port from
getPortProvider(). |
java.lang.String |
getFileSource()
Returns the path of WireMock configuration.
|
com.adaptris.tester.runtime.helpers.PortProvider |
getPortProvider()
Returns the
PortProvider |
void |
init()
Initialises WireMock server with port set as value from
getPortProvider() which also added as a helper
property to "wire.mock.helper.port". |
void |
setFileSource(java.lang.String fileSource)
Sets the path of WireMock configuration.
|
void |
setPortProvider(com.adaptris.tester.runtime.helpers.PortProvider portProvider)
Sets the
PortProvider |
public static final java.lang.String WIRE_MOCK_HELPER_PORT_PROPERTY_NAME
public void init()
throws com.adaptris.tester.runtime.ServiceTestException
getPortProvider() which also added as a helper
property to "wire.mock.helper.port".init in class com.adaptris.tester.runtime.helpers.Helpercom.adaptris.tester.runtime.ServiceTestException - wrapping any thrown exceptionpublic void close()
throws java.io.IOException
getPortProvider().java.io.IOExceptionpublic java.lang.String getFileSource()
public void setFileSource(java.lang.String fileSource)
fileSource - Path of WireMock configuration.public com.adaptris.tester.runtime.helpers.PortProvider getPortProvider()
PortProviderpublic void setPortProvider(com.adaptris.tester.runtime.helpers.PortProvider portProvider)
PortProviderportProvider - The port provider