Updated Branches: refs/heads/camel-2.12.x 3e1198446 -> ecbb9498d refs/heads/master e0be135e1 -> 420ab5d2d
Add test that I forgot Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/86ea35eb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/86ea35eb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/86ea35eb Branch: refs/heads/master Commit: 86ea35eb8df65908b213649e1add9ef9e15ad5fa Parents: 59a5367 Author: Jonathan Anstey <jans...@gmail.com> Authored: Thu Sep 5 10:12:35 2013 -0230 Committer: Jonathan Anstey <jans...@gmail.com> Committed: Thu Sep 5 11:30:11 2013 -0230 ---------------------------------------------------------------------- .../YammerRelationshipInJsonRouteTest.java | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/86ea35eb/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerRelationshipInJsonRouteTest.java ---------------------------------------------------------------------- diff --git a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerRelationshipInJsonRouteTest.java b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerRelationshipInJsonRouteTest.java new file mode 100644 index 0000000..c486239 --- /dev/null +++ b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerRelationshipInJsonRouteTest.java @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.yammer; + + +import java.util.List; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.component.yammer.model.Relationships; +import org.junit.Test; + +public class YammerRelationshipInJsonRouteTest extends YammerComponentTestSupport { + + @SuppressWarnings("unchecked") + @Test + public void testConsumeAllUsers() throws Exception { + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedMinimumMessageCount(1); + assertMockEndpointsSatisfied(); + + Exchange exchange = mock.getExchanges().get(0); + String relationships = exchange.getIn().getBody(String.class); + + assertEquals(getMessages(), relationships); + } + + @Override + protected String jsonFile() { + return "/relationships.json"; + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + public void configure() { + // using dummy keys here since we are mocking out calls to yammer.com with static json; in a real app, please use your own keys! + from("yammer:relationships?consumerKey=aConsumerKey&consumerSecret=aConsumerSecretKey&accessToken=aAccessToken&useJson=true").to("log:foo").to("mock:result"); + } + }; + } +}