title: Testing Camel REST DSL Consumer Template
body: <p>I have the following code: </p>
  
  <pre><code>import org.apache.camel.builder.RouteBuilder;
  import org.apache.camel.model.rest.RestBindingMode;
  
  public class OrderNumberRouteBuilder extends RouteBuilder {
  
      @Override
      public void configure() throws Exception {
          restConfiguration().component("servlet").bindingMode(RestBindingMode.json)          
              .dataFormatProperty("prettyPrint", "true")
              .contextPath("suppliera/rest").port(8080);
  
          rest("/ordernumber").description("ordernumber rest service")
              .consumes("application/json").produces("application/json")
  
              .get("/{id}").description("get ordernumber").outType(ServiceResponse.class)
              .to("bean:orderNumberService?method=getOrderNumber(${header.id})");
      }
  }
  </code></pre>
  
  <p>How can I use JUnit to test this code? Can <code>CamelTestSupport</code> handle it?</p>
  
  <p>I want to create a test like: </p>
  
  <pre><code>@Produce(------myendpoint----) 
  protected ProducerTemplate testProducer; 
  
  public void mytest(){
  testProducer.requestBody("foo");
  }
  </code></pre>
  
  <p>how can I mock that? what I put in -----myendpoint---- to reference that route?</p>