title: Apache Camel: usage of ValueBuilder.convertTo in mock endpoint expectations
body: <p>I cannot figure out how to use <code>ValueBuilder.convertTo</code> as a clause in Apache Camel's mock endpoint expectations. For some reason the expectations containing <code>convertTo</code> are ignored.</p>
  
  <p>Here's a test that illustrates the issue:</p>
  
  <pre><code>package wheleph;
  
  import org.apache.camel.builder.RouteBuilder;
  import org.apache.camel.component.mock.MockEndpoint;
  import org.apache.camel.test.junit4.CamelTestSupport;
  import org.junit.Test;
  
  public class ConvertToTest extends CamelTestSupport {
  
      private static final String INBOUND_ENDPOINT = "direct:inbound";
      private static final String OUTBOUND_ENDPOINT = "mock:outbound";
  
      @Test
      public void testConvertToBody() throws InterruptedException {
          MockEndpoint mockOutboundEndpoint = getMockEndpoint(OUTBOUND_ENDPOINT);
          mockOutboundEndpoint.expectedMessageCount(1);
          mockOutboundEndpoint.message(0).body().convertTo(String.class).isEqualTo("Blah");
  
          template.sendBody(INBOUND_ENDPOINT, "Message 1");
  
          assertMockEndpointsSatisfied();
      }
  
      @Override
      protected RouteBuilder createRouteBuilder() throws Exception {
          return new RouteBuilder() {
              @Override
              public void configure() throws Exception {
                  from(INBOUND_ENDPOINT).
                          to(OUTBOUND_ENDPOINT);
              }
          };
      }
  }
  </code></pre>
  
  <p>The test case above should fail because the mock endpoint actually receives a message with body "Message 1" which is not equal to the expected value "Blah". However this test is green.</p>
  
  <p>But if I remove <code>convertTo</code> from the mock endpoint setup (<code>mockOutboundEndpoint.message(0).body().convertTo(String.class).isEqualTo("Blah")</code>)
  then the test fails as it should.</p>
  
  <p>Am I using <code>ValueBuilder.convertTo</code> in a wrong way or is this a bug in Apache Camel testing framework?</p>