Package net.officefloor.woof.mock
Class MockWoofServerRule
- java.lang.Object
-
- net.officefloor.server.http.mock.MockHttpServer
-
- net.officefloor.woof.mock.MockWoofServer
-
- net.officefloor.woof.mock.MockWoofServerRule
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,HttpServerImplementation
,HttpServerLocation
,org.junit.rules.TestRule
public class MockWoofServerRule extends MockWoofServer implements org.junit.rules.TestRule
TestRule
for running theMockWoofServer
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.woof.mock.MockWoofServer
MockWoofServer.MockWoofInput, MockWoofServer.MockWoofResponseImpl, MockWoofServer.MockWoofServerConfigurer
-
Nested classes/interfaces inherited from class net.officefloor.server.http.mock.MockHttpServer
MockHttpServer.MockHttpRequest, MockHttpServer.MockHttpResponseImpl, MockHttpServer.MockServerHttpConnectionImpl
-
-
Field Summary
-
Fields inherited from interface net.officefloor.server.http.HttpServerLocation
PROPERTY_CLUSTER_HOST_NAME, PROPERTY_CLUSTER_HTTP_PORT, PROPERTY_CLUSTER_HTTPS_PORT, PROPERTY_DOMAIN, PROPERTY_HTTP_PORT, PROPERTY_HTTPS_PORT
-
-
Constructor Summary
Constructors Constructor Description MockWoofServerRule(java.lang.Object testInstance, MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.MockWoofServerRule(MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.junit.runners.model.Statement
apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
MockWoofServerRule
profile(java.lang.String profile)
Builder pattern for adding an additional profile.MockWoofServerRule
property(java.lang.String name, java.lang.String value)
Builder pattern for adding an override property.MockWoofServerRule
timeout(int timeout)
=============== MockWoofServer =====================-
Methods inherited from class net.officefloor.woof.mock.MockWoofServer
close, createMockHttpResponse, createMockHttpResponse, createSectionServicer, getOfficeFloor, mockJsonRequest, mockJsonRequest, open, open, open, open, open, send, sendFollowRedirect
-
Methods inherited from class net.officefloor.server.http.mock.MockHttpServer
configureHttpServer, configureMockHttpServer, configureMockHttpServer, createClientUrl, getClusterHostName, getClusterHttpPort, getClusterHttpsPort, getDomain, getHttpPort, getHttpsPort, mockConnection, mockConnection, mockRequest, mockRequest, mockResponse, mockResponseCookie, send
-
-
-
-
Constructor Detail
-
MockWoofServerRule
public MockWoofServerRule(MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.- Parameters:
configurers
-MockWoofServer.MockWoofServerConfigurer
instances.
-
MockWoofServerRule
public MockWoofServerRule(java.lang.Object testInstance, MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.- Parameters:
testInstance
- Test instance to dependency inject.configurers
-MockWoofServer.MockWoofServerConfigurer
instances.
-
-
Method Detail
-
profile
public MockWoofServerRule profile(java.lang.String profile)
Builder pattern for adding an additional profile.- Parameters:
profile
- Additional profile.- Returns:
this
.
-
property
public MockWoofServerRule property(java.lang.String name, java.lang.String value)
Builder pattern for adding an override property.- Parameters:
name
- Name.value
- Value.- Returns:
this
.
-
timeout
public MockWoofServerRule timeout(int timeout)
=============== MockWoofServer =====================- Overrides:
timeout
in classMockHttpServer
- Parameters:
timeout
- Timeout in milliseconds.- Returns:
this
.
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
- Specified by:
apply
in interfaceorg.junit.rules.TestRule
-
-