/**
 * 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.io.InputStream;
import java.util.Collection;

import org.apache.camel.Endpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Before;

public abstract class YammerComponentTestSupport extends CamelTestSupport {

    protected YammerComponent yammerComponent;

    public YammerComponentTestSupport() {
        super();
    }

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        
        InputStream is = getClass().getResourceAsStream(jsonFile());        
        String messages = 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));
            }
        }
    }

    protected String jsonFile() {
        return "/messages.json";
    }

}
@@ -1138,16 +1138,49 @@
 ponent;%0A
+    private String messages;%0A    
 %0A    pub
@@ -1428,26 +1428,20 @@
     
-String m
+setM
 essages
- = 
+(
 cont
@@ -1490,16 +1490,17 @@
 ass, is)
+)
 ;    %0A  
@@ -1850,24 +1850,29 @@
 questor(
-m
+getM
 essages
+()
 ));%0A    
@@ -1972,9 +1972,169 @@
 %0A    %7D%0A%0A
+    protected String getMessages() %7B%0A        return messages;%0A    %7D%0A%0A    protected void setMessages(String messages) %7B%0A        this.messages = messages;%0A    %7D%0A%0A
 %7D

Test for using raw JSON in camel-yammer