Package org.citrusframework.endpoint
Class AbstractEndpointComponent
java.lang.Object
org.citrusframework.endpoint.AbstractEndpointComponent
- All Implemented Interfaces:
EndpointComponent
- Direct Known Subclasses:
DirectEndpointComponent
Default endpoint component reads component name from endpoint uri and parses parameters from uri using
the HTTP uri pattern.
http://localhost:8080?param1=value1¶m2=value2¶m3=value3
jms:queue.name?connectionFactory=specialConnectionFactory
soap:localhost:8080?soapAction=sayHello
- Since:
- 1.4.1
-
Field Summary
Fields inherited from interface org.citrusframework.endpoint.EndpointComponent
ENDPOINT_NAME, logger, RESOURCE_PATH, TYPE_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor using the name for this component. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EndpointcreateEndpoint(String resourcePath, Map<String, String> parameters, TestContext context) Create endpoint instance from uri resource and parameters.createEndpoint(String endpointUri, TestContext context) protected voidenrichEndpointConfiguration(EndpointConfiguration endpointConfiguration, Map<String, String> parameters, TestContext context) Sets properties on endpoint configuration using method reflection.getEndpointConfigurationParameters(Map<String, String> parameters, Class<? extends EndpointConfiguration> endpointConfigurationType) Removes non config parameters from list of endpoint parameters according to given endpoint configuration type.getName()getParameters(String endpointUri) protected StringgetParameterString(Map<String, String> parameters, Class<? extends EndpointConfiguration> endpointConfigurationType) Filters non endpoint configuration parameters from parameter list and puts them together as parameters string.
-
Constructor Details
-
AbstractEndpointComponent
Default constructor using the name for this component.- Parameters:
name-
-
-
Method Details
-
createEndpoint
- Specified by:
createEndpointin interfaceEndpointComponent
-
getParameters
- Specified by:
getParametersin interfaceEndpointComponent
-
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
- Specified by:
getNamein interfaceEndpointComponent
-