Skip to content

Instantly share code, notes, and snippets.

@bogdanalbei
Created July 24, 2016 13:01
Show Gist options
  • Select an option

  • Save bogdanalbei/e1f8fed4a0b9ba0b09242de1fdd000e7 to your computer and use it in GitHub Desktop.

Select an option

Save bogdanalbei/e1f8fed4a0b9ba0b09242de1fdd000e7 to your computer and use it in GitHub Desktop.
@Test
public void test_fruit_is_routed_to_the_fruits_processor_via_groceries_queue() throws InterruptedException {
//given
Fruit apple = new Fruit("apple", "England");
ProducerTemplate producer = camelContext.createProducerTemplate();
//when
producer.sendBody(GroceriesRouteBuilder.GROCERIES_QUEUE, apple);
//then
fruitProcessor.expectedBodiesReceived(apple);
fruitProcessor.assertIsSatisfied();
vegetableProcessor.expectedMessageCount(0);
vegetableProcessor.assertIsSatisfied();
}
@Test
public void test_vegetable_is_routed_to_the_fruits_processor_via_groceries_queue() throws InterruptedException {
//given
Vegetable potato = new Vegetable("potato", "Scotland");
ProducerTemplate producer = camelContext.createProducerTemplate();
//when
producer.sendBody(GroceriesRouteBuilder.GROCERIES_QUEUE, potato);
//then
vegetableProcessor.expectedBodiesReceived(potato);
vegetableProcessor.assertIsSatisfied();
fruitProcessor.expectedMessageCount(0);
fruitProcessor.assertIsSatisfied();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment