public class InterceptSendToMockEndpointStrategy extends Object implements org.apache.camel.spi.EndpointStrategy
EndpointStrategy
which is capable of mocking endpoints.
This strategy will only apply when new endpoints are being created. If you want to replace
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,
org.apache.camel.Endpoint endpoint,
String pattern)
Does the pattern match the endpoint?
|
protected org.apache.camel.Producer |
onInterceptEndpoint(String uri,
org.apache.camel.Endpoint endpoint,
MockEndpoint mockEndpoint,
org.apache.camel.Producer mockProducer)
Callback when an endpoint was intercepted with the given mock endpoint
|
org.apache.camel.Endpoint |
registerEndpoint(String uri,
org.apache.camel.Endpoint 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 org.apache.camel.Endpoint registerEndpoint(String uri, org.apache.camel.Endpoint endpoint)
registerEndpoint
in interface org.apache.camel.spi.EndpointStrategy
protected boolean matchPattern(String uri, org.apache.camel.Endpoint endpoint, String pattern)
uri
- the uriendpoint
- the endpointpattern
- the patternprotected org.apache.camel.Producer onInterceptEndpoint(String uri, org.apache.camel.Endpoint endpoint, MockEndpoint mockEndpoint, org.apache.camel.Producer mockProducer)
uri
- the uriendpoint
- the endpointmockEndpoint
- the mocked endpointmockProducer
- the mock producerApache Camel