Created
July 24, 2016 13:01
-
-
Save bogdanalbei/e1f8fed4a0b9ba0b09242de1fdd000e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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