Class AbstractEndpointComponent

java.lang.Object
org.citrusframework.endpoint.AbstractEndpointComponent
All Implemented Interfaces:
EndpointComponent
Direct Known Subclasses:
DirectEndpointComponent

public abstract class AbstractEndpointComponent extends Object implements EndpointComponent
Default endpoint component reads component name from endpoint uri and parses parameters from uri using the HTTP uri pattern. http://localhost:8080?param1=value1&param2=value2&param3=value3 jms:queue.name?connectionFactory=specialConnectionFactory soap:localhost:8080?soapAction=sayHello
Since:
1.4.1
  • Constructor Details

    • AbstractEndpointComponent

      public AbstractEndpointComponent(String name)
      Default constructor using the name for this component.
      Parameters:
      name -
  • Method Details

    • createEndpoint

      public Endpoint createEndpoint(String endpointUri, TestContext context)
      Specified by:
      createEndpoint in interface EndpointComponent
    • getParameters

      public Map<String,String> getParameters(String endpointUri)
      Specified by:
      getParameters in interface EndpointComponent
    • enrichEndpointConfiguration

      protected void enrichEndpointConfiguration(EndpointConfiguration endpointConfiguration, Map<String,String> parameters, TestContext context)
      Sets properties on endpoint configuration using method reflection.
      Parameters:
      endpointConfiguration -
      parameters -
      context -
    • getEndpointConfigurationParameters

      protected Map<String,String> getEndpointConfigurationParameters(Map<String,String> parameters, Class<? extends EndpointConfiguration> endpointConfigurationType)
      Removes non config parameters from list of endpoint parameters according to given endpoint configuration type. All parameters that do not reside to a endpoint configuration setting are removed so the result is a qualified list of endpoint configuration parameters.
      Parameters:
      parameters -
      endpointConfigurationType -
      Returns:
    • getParameterString

      protected String getParameterString(Map<String,String> parameters, Class<? extends EndpointConfiguration> endpointConfigurationType)
      Filters non endpoint configuration parameters from parameter list and puts them together as parameters string. According to given endpoint configuration type only non endpoint configuration settings are added to parameter string.
      Parameters:
      parameters -
      endpointConfigurationType -
      Returns:
    • createEndpoint

      protected abstract Endpoint createEndpoint(String resourcePath, Map<String,String> parameters, TestContext context)
      Create endpoint instance from uri resource and parameters.
      Parameters:
      resourcePath -
      parameters -
      context -
      Returns:
    • getName

      public String getName()
      Specified by:
      getName in interface EndpointComponent