Skip to content

Instantly share code, notes, and snippets.

@mzimecki
Last active May 27, 2017 19:15
Show Gist options
  • Save mzimecki/43cd3971f21ec42ec8669aa989c1341e to your computer and use it in GitHub Desktop.
Save mzimecki/43cd3971f21ec42ec8669aa989c1341e to your computer and use it in GitHub Desktop.
Mock endpoint
private void configureMockEndpoint() throws Exception {
final AdviceWithRouteBuilder mockAdvice = new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
replaceFromWith("direct:deadLetterQueueMock");
interceptSendToEndpoint("jms:*")
.skipSendToOriginalEndpoint()
.process(exchange -> exchange.getIn().setBody(TEST_BODY_PAYLOAD));
};
};
context().getRouteDefinition(ServiceConstants.QUEUE_READER_ROUTE_ID).adviceWith(context(), mockAdvice);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment