Class SoapExtension

java.lang.Object
com.github.skjolber.mockito.soap.SoapExtension
All Implemented Interfaces:
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
Direct Known Subclasses:
SoapServiceExtension

public abstract class SoapExtension extends Object implements org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
  • Constructor Details

    • SoapExtension

      public SoapExtension()
  • Method Details

    • 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 to
      port - service class
      address - address, i.e. http://localhost:1234
      wsdlLocation - wsdl location, or null
      schemaLocations - 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 to
      port - service class
      address - address, i.e. http://localhost:1234
      wsdlLocation - wsdl location, or null
      schemaLocations - schema locations, or null
      properties - additional properties, like mtom-enabled etc.
    • mock

      public <T> T mock(Class<T> port, String address)
      Create (and start) service endpoint with mock delegate. No schema validation.
      Type Parameters:
      T - class to be mocked
      Parameters:
      port - service class
      address - address, i.e. http://localhost:1234
      Returns:
      the mockito mock to which server calls are delegated
    • mock

      public <T> T mock(Class<T> port, String address, Map<String,Object> properties)
      Create (and start) service endpoint with mock delegate. No schema validation.
      Type Parameters:
      T - class to be mocked
      Parameters:
      port - service class
      address - address, i.e. http://localhost:1234
      properties - additional properties, like mtom-enabled etc.
      Returns:
      the mockito mock to which server calls are delegated
    • mock

      public <T> T mock(Class<T> port, String address, String wsdlLocation)
      Create (and start) service endpoint with mock delegate.
      Type Parameters:
      T - class to be mocked
      Parameters:
      port - service class
      address - address, i.e. http://localhost:1234
      wsdlLocation - 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 class
      address - address, i.e. http://localhost:1234
      wsdlLocation - wsdl location
      properties - additional properties, like mtom-enabled etc.
      Returns:
      the mockito mock to which server calls are delegated
    • mock

      public <T> T mock(Class<T> port, String address, List<String> schemaLocations)
      Create (and start) service endpoint with mock delegate.
      Type Parameters:
      T - class to be mocked
      Parameters:
      port - service class
      address - address, i.e. http://localhost:1234
      schemaLocations - 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 class
      address - address, i.e. http://localhost:1234
      schemaLocations - schema locations
      properties - additional properties, like mtom-enabled and so
      Returns:
      the mockito mock to which server calls are delegated
    • assertValidParams

      protected <T> void assertValidParams(T target, Class<T> port, String address)
    • assertValidAddress

      protected void assertValidAddress(String address)
    • parsePort

      protected int parsePort(String address)
    • processProperties

      protected Map<String,Object> processProperties(Map<String,Object> properties, String wsdlLocation, List<String> schemaLocations)
    • properties

      public static Map<String,Object> properties(Object... properties)
    • verifyProperties

      protected static void verifyProperties(Object... properties)