CAMEL-11225: fix tests
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/04d0b639 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/04d0b639 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/04d0b639 Branch: refs/heads/camel-2.18.x Commit: 04d0b639114c4e0e64c7c5d4d6c362f443990554 Parents: ffab991 Author: lburgazzoli <lburgazz...@gmail.com> Authored: Mon May 8 15:06:53 2017 +0200 Committer: lburgazzoli <lburgazz...@gmail.com> Committed: Tue May 9 11:44:27 2017 +0200 ---------------------------------------------------------------------- .../camel/spring/CircularComponentCreationTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/04d0b639/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java index 05f50ed..0a74bfe 100644 --- a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java +++ b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java @@ -29,7 +29,14 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; public class CircularComponentCreationTest { @Test public void testSimple() { - doTest("org/apache/camel/spring/CircularComponentCreationSimpleTest.xml"); + try { + doTest("org/apache/camel/spring/CircularComponentCreationSimpleTest.xml"); + + Assert.fail("Exception should have been thrown"); + } catch (Exception e) { + Assert.assertTrue(e instanceof RuntimeCamelException); + Assert.assertTrue(e.getCause() instanceof FailedToCreateRouteException); + } } @Test @@ -47,9 +54,6 @@ public class CircularComponentCreationTest { try { applicationContext = new ClassPathXmlApplicationContext(path); camelContext = new SpringCamelContext(applicationContext); - } catch (Exception e) { - Assert.assertTrue(e instanceof RuntimeCamelException); - Assert.assertTrue(e.getCause() instanceof FailedToCreateRouteException); } finally { IOHelper.close(applicationContext); }