camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [10/14] camel git commit: Refactored test to use blueprint
Date Mon, 01 Jun 2015 07:10:24 GMT
Refactored test to use blueprint


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dc8e761e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dc8e761e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dc8e761e

Branch: refs/heads/master
Commit: dc8e761e475b3b1d7e7c9e21ef1539b4b9b0eca5
Parents: c14d4ef
Author: Mike Kennedy <michael.kennedy@ucr.edu>
Authored: Sat May 30 23:46:49 2015 -0700
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jun 1 08:55:13 2015 +0200

----------------------------------------------------------------------
 .../component/slack/SlackProducerTest.java      | 27 +++++++++++++++++---
 1 file changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dc8e761e/components/camel-slack/src/test/java/org/apache/camel/component/slack/SlackProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-slack/src/test/java/org/apache/camel/component/slack/SlackProducerTest.java
b/components/camel-slack/src/test/java/org/apache/camel/component/slack/SlackProducerTest.java
index 52e12b9..29691fc 100644
--- a/components/camel-slack/src/test/java/org/apache/camel/component/slack/SlackProducerTest.java
+++ b/components/camel-slack/src/test/java/org/apache/camel/component/slack/SlackProducerTest.java
@@ -1,7 +1,26 @@
 package org.apache.camel.component.slack;
 
-/**
- * Created by mikek on 5/30/15.
- */
-public class SlackProducerTest {
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.Test;
+
+public class SlackProducerTest extends CamelBlueprintTestSupport {
+
+    @Override
+    protected String getBlueprintDescriptor() {
+        return "OSGI-INF/blueprint/blueprint.xml";
+    }
+
+    @Test
+    public void testSlackMessage() throws Exception {
+        getMockEndpoint(("mock:errors")).expectedMessageCount(0);
+        template.sendBody("direct:test", "Hello from Camel!");
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testSlackError() throws Exception {
+        getMockEndpoint(("mock:errors")).expectedMessageCount(1);
+        template.sendBody("direct:error", "Error from Camel!");
+        assertMockEndpointsSatisfied();
+    }
 }


Mime
View raw message