public class InterceptSendToMockEndpointStrategy extends Object implements EndpointStrategy
EndpointStrategy
which is capable of mocking endpoints.
This strategy will only apply when new endpoints is being created. If you want to apply
existing endpoints, you will have to remove them from the CamelContext
beforehand.Constructor and Description |
---|
InterceptSendToMockEndpointStrategy()
Mock all endpoints.
|
InterceptSendToMockEndpointStrategy(String pattern)
Mock endpoints based on the given pattern.
|
InterceptSendToMockEndpointStrategy(String pattern,
boolean skip)
Mock endpoints based on the given pattern.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
matchPattern(String uri,
Endpoint endpoint,
String pattern)
Does the pattern match the endpoint?
|
protected Producer |
onInterceptEndpoint(String uri,
Endpoint endpoint,
MockEndpoint mockEndpoint,
Producer mockProducer)
Callback when an endpoint was intercepted with the given mock endpoint
|
Endpoint |
registerEndpoint(String uri,
Endpoint endpoint)
Register the endpoint.
|
String |
toString() |
public InterceptSendToMockEndpointStrategy()
public InterceptSendToMockEndpointStrategy(String pattern)
pattern
- the pattern.EndpointHelper.matchEndpoint(org.apache.camel.CamelContext, String, String)
public InterceptSendToMockEndpointStrategy(String pattern, boolean skip)
pattern
- the pattern.skip
- true to skip sending after the detour to the original endpointEndpointHelper.matchEndpoint(org.apache.camel.CamelContext, String, String)
public Endpoint registerEndpoint(String uri, Endpoint endpoint)
EndpointStrategy
registerEndpoint
in interface EndpointStrategy
uri
- uri of endpointendpoint
- the current endpoint to registerprotected boolean matchPattern(String uri, Endpoint endpoint, String pattern)
uri
- the uriendpoint
- the endpointpattern
- the patternprotected Producer onInterceptEndpoint(String uri, Endpoint endpoint, MockEndpoint mockEndpoint, Producer mockProducer)
uri
- the uriendpoint
- the endpointmockEndpoint
- the mocked endpointmockProducer
- the mock producerApache Camel