use of org.apache.camel.impl.InterceptSendToEndpoint in project camel by apache.
the class MockEndpoint method resetMocks.
/**
* Reset all mock endpoints
*
* @param context the camel context used to find all the available endpoints to reset
*/
public static void resetMocks(CamelContext context) {
ObjectHelper.notNull(context, "camelContext");
Collection<Endpoint> endpoints = context.getEndpoints();
for (Endpoint endpoint : endpoints) {
// if the endpoint was intercepted we should get the delegate
if (endpoint instanceof InterceptSendToEndpoint) {
endpoint = ((InterceptSendToEndpoint) endpoint).getDelegate();
}
if (endpoint instanceof MockEndpoint) {
MockEndpoint mockEndpoint = (MockEndpoint) endpoint;
mockEndpoint.reset();
}
}
}
Aggregations