1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.http.functional;
12
13 import org.mule.api.MuleException;
14 import org.mule.api.MuleMessage;
15 import org.mule.module.client.MuleClient;
16 import org.mule.tck.FunctionalTestCase;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 public class HttpFunctionalWithQueryTestCase extends FunctionalTestCase
22 {
23 protected String getConfigResources()
24 {
25 return "http-functional-test-with-query.xml";
26 }
27
28 public void testSend() throws Exception
29 {
30 MuleClient client = new MuleClient();
31 Map props = new HashMap();
32 MuleMessage result = client.send("clientEndpoint1", null, props);
33 assertEquals("boobar", result.getPayloadAsString());
34 }
35
36 public void testSendWithParams() throws Exception
37 {
38 MuleClient client = new MuleClient();
39 Map props = new HashMap();
40 props.put("foo", "noo");
41 props.put("far", "nar");
42 MuleMessage result = client.send("clientEndpoint2", null, props);
43 assertEquals("noonar", result.getPayloadAsString());
44 }
45
46 public void testSendWithBadParams() throws Exception
47 {
48 MuleClient client = new MuleClient();
49 Map props = new HashMap();
50 props.put("hoo", "noo");
51 props.put("har", "nar");
52 try
53 {
54 MuleMessage result = client.send("clientEndpoint2", null, props);
55 fail("Parameters on the request do not match up");
56 }
57 catch (MuleException e)
58 {
59
60 }
61 }
62 }