<commit_before><commit_msg>- Example how to test camel routs using ProducerTemplate<commit_after>package se.vgregion.messagebus;

import org.apache.camel.*;
import org.apache.camel.component.cxf.CxfConstants;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Assert;
import org.junit.Test;

/**
 * Created by IntelliJ IDEA.
 * User: david
 * Date: 3/8-11
 * Time: 12:59
 */
public class RestTest extends CamelTestSupport {


    @Test
    public void callTestCounter() {

        Exchange exchange = template.send("cxfrs://http://www.google.com",
                new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                exchange.setPattern(ExchangePattern.InOut);
                Message inMessage = exchange.getIn();
                inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
                inMessage.setHeader(Exchange.HTTP_METHOD, "GET");
//                inMessage.setHeader(Exchange.HTTP_METHOD, "POST");
//                inMessage.setHeader(Exchange.HTTP_PATH,"/");
                inMessage.setHeader(Exchange.ACCEPT_CONTENT_TYPE,"application/json");

                inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, String.class);
                inMessage.setBody(" ");
            }
        });

        Assert.assertNotNull(exchange.getOut());
    }
}
{'fraction_non_alphanumeric': 0.11126961483594865, 'fraction_numerical': 0.006419400855920114, 'mean_word_length': 2.634715025906736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7592923', 'n_tokens_mistral': 430, 'n_tokens_neox': 395, 'n_words': 67}