Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then the test method will then run which invokes the MockEndpoint.assertIsSatisfied(camelContext) method which asserts that all of the Mock and Test endpoints have their expectations met.

...

You can completely avoid using an XML configuration file by using Spring Java Config.

Here is an example using Java Config.

Wiki Markup
{snippet:lang=java|id=example|url=activemq/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java}

...

Code Block
public class Foo {
  @EndpointInject(uri="activemq:foo.bar")
  ProducerTemplate producer;

  public void doSomething() {
    // lets send a message!
    producer.sendBody("<hello>world!</hello>");
  }

  // lets consume messages from the 'cheese' queue
  @MessageDriven(uri="activemq:cheese")
  public void onCheese(String name) {
    ...
  }
}

See Also