Search in sources :

Example 6 with InterceptSendToEndpoint

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();
        }
    }
}
Also used : InterceptSendToEndpoint(org.apache.camel.impl.InterceptSendToEndpoint) Endpoint(org.apache.camel.Endpoint) UriEndpoint(org.apache.camel.spi.UriEndpoint) DefaultEndpoint(org.apache.camel.impl.DefaultEndpoint) InterceptSendToEndpoint(org.apache.camel.impl.InterceptSendToEndpoint) BrowsableEndpoint(org.apache.camel.spi.BrowsableEndpoint)

Aggregations

Endpoint (org.apache.camel.Endpoint)6 InterceptSendToEndpoint (org.apache.camel.impl.InterceptSendToEndpoint)6 DefaultEndpoint (org.apache.camel.impl.DefaultEndpoint)4 BrowsableEndpoint (org.apache.camel.spi.BrowsableEndpoint)4 UriEndpoint (org.apache.camel.spi.UriEndpoint)4 HashMap (java.util.HashMap)1 Processor (org.apache.camel.Processor)1 Producer (org.apache.camel.Producer)1 ServicePoolAware (org.apache.camel.ServicePoolAware)1 ProducerCache (org.apache.camel.impl.ProducerCache)1 InterceptEndpointProcessor (org.apache.camel.processor.InterceptEndpointProcessor)1 EndpointStrategy (org.apache.camel.spi.EndpointStrategy)1