Package com.github.skjolber.mockito.soap
Class SoapServiceRule
java.lang.Object
org.junit.rules.ExternalResource
com.github.skjolber.mockito.soap.SoapServiceRule
- All Implemented Interfaces:
org.junit.rules.TestRule
- Direct Known Subclasses:
SoapEndpointRule,SoapServerRule
public abstract class SoapServiceRule
extends org.junit.rules.ExternalResource
Rule for mocking SOAP services.
- Author:
- thomas.skjolberg@gmail.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertValidAddress(String address) protected <T> voidassertValidParams(T target, Class<T> port, String address) <T> TCreate (and start) service endpoint with mock delegate.<T> TCreate (and start) service endpoint with mock delegate.<T> TCreate (and start) service endpoint with mock delegate.<T> TCreate (and start) service endpoint with mock delegate.<T> TCreate (and start) service with mock delegate and additional properties.<T> TCreate (and start) service endpoint with mock delegate.static SoapServiceRulestatic SoapEndpointRulenewInstance(int portRangeStart, int portRangeEnd, String... portNames) static SoapEndpointRulenewInstance(String... portNames) protected intproperties(Object... properties) <T> voidCreate (and start) an endpoint.abstract <T> voidproxy(T target, Class<T> port, String address, String wsdlLocation, List<String> schemaLocations, Map<String, Object> properties) Create (and start) an endpoint with the given properties.abstract voidstart()(Re)start services.abstract voidstop()Stop services.protected static voidverifyProperties(Object... properties) Methods inherited from class org.junit.rules.ExternalResource
after, apply, before
-
Constructor Details
-
SoapServiceRule
public SoapServiceRule()
-
-
Method Details
-
newInstance
-
newInstance
-
newInstance
public static SoapEndpointRule newInstance(int portRangeStart, int portRangeEnd, String... portNames) -
proxy
public <T> void proxy(T target, Class<T> port, String address, String wsdlLocation, List<String> schemaLocations) Create (and start) an endpoint.- Type Parameters:
T- the type of the mocked class- Parameters:
target- instance calls are forwarded toport- service classaddress- address, i.e. http://localhost:1234wsdlLocation- wsdl location, or nullschemaLocations- schema locations, or null
-
proxy
public abstract <T> void proxy(T target, Class<T> port, String address, String wsdlLocation, List<String> schemaLocations, Map<String, Object> properties) Create (and start) an endpoint with the given properties.- Type Parameters:
T- the type of the mocked class- Parameters:
target- instance calls are forwarded toport- service classaddress- address, i.e. http://localhost:1234wsdlLocation- wsdl location, or nullschemaLocations- schema locations, or nullproperties- additional properties, like mtom-enabled etc.
-
mock
Create (and start) service endpoint with mock delegate. No schema validation.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234- Returns:
- the mockito mock to which server calls are delegated
-
mock
Create (and start) service endpoint with mock delegate. No schema validation.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234properties- additional properties, like mtom-enabled etc.- Returns:
- the mockito mock to which server calls are delegated
-
mock
Create (and start) service endpoint with mock delegate.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234wsdlLocation- wsdl location- Returns:
- the mockito mock to which server calls are delegated
-
mock
public <T> T mock(Class<T> port, String address, String wsdlLocation, Map<String, Object> properties) Create (and start) service endpoint with mock delegate.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234wsdlLocation- wsdl locationproperties- additional properties, like mtom-enabled etc.- Returns:
- the mockito mock to which server calls are delegated
-
mock
Create (and start) service endpoint with mock delegate.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234schemaLocations- schema locations- Returns:
- the mockito mock to which server calls are delegated
-
mock
public <T> T mock(Class<T> port, String address, List<String> schemaLocations, Map<String, Object> properties) Create (and start) service with mock delegate and additional properties.- Type Parameters:
T- class to be mocked- Parameters:
port- service classaddress- address, i.e. http://localhost:1234schemaLocations- schema locationsproperties- additional properties, like mtom-enabled and so- Returns:
- the mockito mock to which server calls are delegated
-
assertValidParams
-
assertValidAddress
-
parsePort
-
processProperties
-
properties
-
verifyProperties
-
stop
public abstract void stop()Stop services. -
start
public abstract void start()(Re)start services.
-