Package net.officefloor.woof.mock
Class MockWoofServerExtension
- java.lang.Object
-
- net.officefloor.server.http.mock.MockHttpServer
-
- net.officefloor.woof.mock.MockWoofServer
-
- net.officefloor.woof.mock.MockWoofServerExtension
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,HttpServerImplementation
,HttpServerLocation
,org.junit.jupiter.api.extension.AfterAllCallback
,org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeAllCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.ParameterResolver
public class MockWoofServerExtension extends MockWoofServer implements org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterAllCallback
Extension
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 MockWoofServerExtension()
DefaultConstructor
to use withExtendWith
.MockWoofServerExtension(MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
void
afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
MockWoofServerExtension
profile(java.lang.String profile)
Builder pattern for adding an additional profile.MockWoofServerExtension
property(java.lang.String name, java.lang.String value)
Builder pattern for adding an override property.java.lang.Object
resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
boolean
supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
-
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, timeout
-
-
-
-
Constructor Detail
-
MockWoofServerExtension
public MockWoofServerExtension()
DefaultConstructor
to use withExtendWith
.
-
MockWoofServerExtension
public MockWoofServerExtension(MockWoofServer.MockWoofServerConfigurer... configurers)
Instantiate.- Parameters:
configurers
-MockWoofServer.MockWoofServerConfigurer
instances.
-
-
Method Detail
-
profile
public MockWoofServerExtension profile(java.lang.String profile)
Builder pattern for adding an additional profile.- Parameters:
profile
- Additional profile.- Returns:
this
.
-
property
public MockWoofServerExtension property(java.lang.String name, java.lang.String value)
Builder pattern for adding an override property.- Parameters:
name
- Name.value
- Value.- Returns:
this
.
-
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
beforeAll
in interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
- Throws:
java.lang.Exception
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
- Specified by:
supportsParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
resolveParameter
public java.lang.Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
- Specified by:
resolveParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
java.lang.Exception
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
java.lang.Exception
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
afterAll
in interfaceorg.junit.jupiter.api.extension.AfterAllCallback
- Throws:
java.lang.Exception
-
-