I am going crazy here (literally).

This is all I know at this point.

If I use this method exacly as I have it (endpoint names), then all my tests
pass as expected. But if I change anything in the endpoint names, even to be
mock:success, verse mock:success1 then several of my tests fail with
messages not getting routed correctly:

    *public void testCreateInvalidChangeRequest(String inputDestinationURI,
                                               String messageInputBody,
                                               String messageOutputBody
    )
            throws Exception {

        MockEndpoint mockFailureEndpoint = getMockEndpoint("mock:failed1");
        MockEndpoint mockSuccessEndpoint = getMockEndpoint("mock:success1");

        mockFailureEndpoint.expectedBodiesReceived(messageInputBody);
        mockFailureEndpoint.expectedMessageCount(1);
        mockSuccessEndpoint.expectedMessageCount(0);

        try {
            camelContext.addRoutes(new RouteBuilder() {
                public void configure() throws Exception {
                    from("direct:start1")
                            .errorHandler(deadLetterChannel("mock:failed1"))
                            .process(changeRequestProcessor)
                            .to("mock:success1");
                }
            });

            producerTemplate.sendBody("direct:start1", messageInputBody);

            Assert.fail("Should have thrown a RuntimeCamelException");
        } catch (RuntimeCamelException e) {
            //assertIsInstanceOf(e, IllegalArgumentException.class);
            assertIsInstanceOf(e, RuntimeCamelException.class);
        }

        testMocksAreValid();

        MockEndpoint.assertIsSatisfied(mockFailureEndpoint,
mockSuccessEndpoint);

    }
*

I have attached my basetest, and this test in question as well.

Reply via email to