camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject [5/8] git commit: Test for using raw JSON in camel-yammer
Date Thu, 05 Sep 2013 14:01:58 GMT
Test for using raw JSON in camel-yammer


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

Branch: refs/heads/camel-2.12.x
Commit: e66c6f1ae1aec8c6d42bc7406a90a2c806506aca
Parents: 3e11984
Author: Jonathan Anstey <janstey@gmail.com>
Authored: Thu Sep 5 10:09:08 2013 -0230
Committer: Jonathan Anstey <janstey@gmail.com>
Committed: Thu Sep 5 11:31:04 2013 -0230

----------------------------------------------------------------------
 .../component/yammer/YammerComponentTestSupport.java | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e66c6f1a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
index 522f919..f55d5fa 100644
--- a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
+++ b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
@@ -27,7 +27,8 @@ import org.junit.Before;
 public abstract class YammerComponentTestSupport extends CamelTestSupport {
 
     protected YammerComponent yammerComponent;
-
+    private String messages;
+    
     public YammerComponentTestSupport() {
         super();
     }
@@ -38,14 +39,14 @@ public abstract class YammerComponentTestSupport extends CamelTestSupport
{
         super.setUp();
         
         InputStream is = getClass().getResourceAsStream(jsonFile());        
-        String messages = context.getTypeConverter().convertTo(String.class, is);    
+        setMessages(context.getTypeConverter().convertTo(String.class, is));    
         
         yammerComponent = context.getComponent("yammer", YammerComponent.class);
         
         Collection<Endpoint> endpoints = context.getEndpoints();
         for (Endpoint endpoint : endpoints) {
             if (endpoint instanceof YammerEndpoint) {
-                ((YammerEndpoint)endpoint).getConfig().setRequestor(new TestApiRequestor(messages));
+                ((YammerEndpoint)endpoint).getConfig().setRequestor(new TestApiRequestor(getMessages()));
             }
         }
     }
@@ -54,4 +55,12 @@ public abstract class YammerComponentTestSupport extends CamelTestSupport
{
         return "/messages.json";
     }
 
+    protected String getMessages() {
+        return messages;
+    }
+
+    protected void setMessages(String messages) {
+        this.messages = messages;
+    }
+
 }
\ No newline at end of file


Mime
View raw message