Greetings,

I have some camel tests using TestNG and CamelTestSupport. The problem I am 
having is that I can get mock endpoints that don't exist. This makes it a pain 
to debug the tests with complex routes. I was wondering if there is something 
like assertIsReal() to determine if a mock endpoint is actually connected to a 
real endpoint in the route. For example:


    this.context.getRouteDefinition(ROUTE_ID).adviceWith(this.context, new 
AdviceWithRouteBuilder() {

      @Override

      public void configure() throws Exception {

        // mock only log endpoints

        mockEndpointsAndSkip("activemq:*");

      }

    });

Then


    final MockEndpoint first = 
getMockEndpoint("mock:activemq:queue:escalated-cases");

    fifa.expectedBodiesReceived(gson.toJson(fc));

    final MockEndpoint xe = getMandatoryEndpoint("mock:activemq:queue:" + 
"blah", MockEndpoint.class);

In this case the "first" endpoint points to an actual node in the route but the 
xe one does not. The problem is if I get the URI slightly wrong, I spend 20 
minutes chancing ghosts to figure out if the mock is real. It would be better 
if getMockEndpoint() would throw an exception if there is no backing component.

And then the code would throw exceptions if it didn't find the real component.


Robert Simmons Jr. MSc. | Lead Java Architect | EA - Worldwide Customer 
Experience

Reply via email to