Java 类org.apache.camel.component.mock.AssertionClause 实例源码

项目:Camel    文件:ActiveMQPropagateHeadersTest.java   
@Test
public void testForwardingAMessageAcrossJMSKeepingCustomJMSHeaders() throws Exception {
    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);

    resultEndpoint.expectedBodiesReceived(expectedBody);
    AssertionClause firstMessageExpectations = resultEndpoint.message(0);
    firstMessageExpectations.header("cheese").isEqualTo(123);
    firstMessageExpectations.header("JMSReplyTo").isEqualTo(replyQueue);
    firstMessageExpectations.header("JMSCorrelationID").isEqualTo(correlationID);
    firstMessageExpectations.header("JMSType").isEqualTo(messageType);

    template.sendBodyAndHeader("activemq:test.a", expectedBody, "cheese", 123);

    resultEndpoint.assertIsSatisfied();

    List<Exchange> list = resultEndpoint.getReceivedExchanges();
    Exchange exchange = list.get(0);
    String replyTo = exchange.getIn().getHeader("JMSReplyTo", String.class);        
    assertEquals("ReplyTo", replyQueue.toString(), replyTo);
}
项目:de.dentrassi.camel.milo    文件:AbstractMiloServerTest.java   
public static <T> void testBody(final AssertionClause clause, final Class<T> bodyClass,
        final Consumer<T> valueConsumer) {
    clause.predicate(exchange -> {
        final T body = exchange.getIn().getBody(bodyClass);
        valueConsumer.accept(body);
        return true;
    });
}
项目:wildfly-camel    文件:MiloIntegrationTest.java   
private static <T> void testBody(final AssertionClause clause, final Class<T> bodyClass, final Consumer<T> valueConsumer) {
    clause.predicate(exchange -> {
        final T body = exchange.getIn().getBody(bodyClass);
        valueConsumer.accept(body);
        return true;
    });
}
项目:de.dentrassi.camel.milo    文件:AbstractMiloServerTest.java   
public static void testBody(final AssertionClause clause, final Consumer<DataValue> valueConsumer) {
    testBody(clause, DataValue.class, valueConsumer);
}
项目:wildfly-camel    文件:MiloIntegrationTest.java   
private static void testBody(final AssertionClause clause, final Consumer<DataValue> valueConsumer) {
    testBody(clause, DataValue.class, valueConsumer);
}