private CorrelationContext getNonSecureCorrelationContext() { MapBasedCorrelationContext ctx = new MapBasedCorrelationContext(); ctx.put("someKey", "someValue"); return ctx; } }
@Test public void testReceiveResponseRejectsResponseWithArbitraryCorrelationInformation() { // GIVEN a request sent with some additional correlation information // using a matcher set to lax matching UdpMatcher matcher = newMatcher(false); MapBasedCorrelationContext ctx = new MapBasedCorrelationContext(); ctx.put("key", "value"); Exchange exchange = sendRequest(matcher, ctx); // WHEN a response arrives without any correlation information Exchange matchedExchange = matcher.receiveResponse(responseFor(exchange.getCurrentRequest()), null); // THEN assert that the response is not matched assertThat(matchedExchange, is(nullValue())); }