/**
 * Created by Jack on 10/02/2015.
 */
import nz.ac.auckland.morc.*;
import scriptella.configuration.StringResource;
import scriptella.spi.ParametersCallback;
import scriptella.spi.Resource;

public class HTTPConnectionTestMorc extends MorcTestBuilder {

    public void configure(){

        final HTTPConnection httpConnection;
        final ParametersCallback parametersCallback;

        httpConnection = new HTTPConnection();
        httpConnection.setHOST("http://127.0.0.1:8080");
        httpConnection.setTIME_OUT(9999);
        parametersCallback = new ParametersCallback() {
            @Override
            public Object getParameter(String s) {
                return null;
            }
        };


        syncTest("script POST test",new TestBean() {
            @Override
            public void run() throws Exception {

                System.out.println("Test2");
                httpConnection.setTYPE("POST");

                Resource resource = new StringResource("test=test2\n" +
                                                    "test3=test4");

                httpConnection.executeScript(resource,parametersCallback);

            }

        }).addExpectation(syncExpectation("jetty:http://localhost:8080").expectedBody(text("test=test2&test3=test4")).responseBody(text("OK")));

    }
}

@@ -65,16 +65,85 @@
 morc.*;%0A
+import org.apache.camel.Exchange;%0Aimport org.apache.camel.Processor;%0A
 import s
@@ -449,16 +449,17 @@
 lback;%0A%0A
+%0A
         
@@ -1056,26 +1056,23 @@
 source(%22
-test=test2
+abc=123
 %5Cn%22 +%0A  
@@ -1125,20 +1125,90 @@
     
-%22test3=test4
+    %22def=456%5Cn%22 +%0A                                                        %22ghi=789
 %22);%0A
@@ -1384,68 +1384,331 @@
 cted
-Body(text(%22test=test2&test3=test4%22)).responseBody(text(%22OK%22)
+Headers(headers(header(%22abc%22, %22123%22), header(%22def%22, %22456%22), header(%22ghi%22, %22789%22))).mockFeedPreprocessor(new Processor() %7B%0A            @Override%0A            public void process(Exchange exchange) throws Exception %7B%0A                if (exchange.getIn().getBody() == null) exchange.getIn().setBody(%22%22);%0A            %7D%0A        %7D
 ));%0A

Update HTTPConnection.java and tests