1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.soap.axis;
12
13 import org.mule.api.MuleEvent;
14 import org.mule.api.MuleMessage;
15 import org.mule.api.endpoint.OutboundEndpoint;
16 import org.mule.tck.junit4.AbstractMuleContextTestCase;
17
18 import java.util.List;
19 import java.util.Map;
20
21 import org.apache.axis.client.Call;
22 import org.apache.axis.client.Service;
23 import org.junit.Test;
24
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertNotNull;
27
28 public class AxisMessageDispatcherTestCase extends AbstractMuleContextTestCase
29 {
30
31 @Test
32 public void testNullParametersInCallAllowed() throws Exception
33 {
34 OutboundEndpoint ep = muleContext.getEndpointFactory().getOutboundEndpoint(
35 "axis:http://www.muleumo.org/services/myService?method=myTestMethod");
36 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
37 dispatcher.service = new Service();
38 MuleEvent event = getTestEvent("testPayload");
39
40 Call call = dispatcher.getCall(event, new Object[]{null});
41
42 assertNotNull(call);
43
44 MuleMessage msg = event.getMessage();
45 assertNotNull(msg);
46 final Map soapMethods = msg.getOutboundProperty(AxisConnector.SOAP_METHODS);
47 assertEquals(1, soapMethods.size());
48 final List values = (List)soapMethods.get("myTestMethod");
49 assertNotNull(values);
50 assertEquals(1, values.size());
51 assertEquals("value0;qname{:anyType:http://www.w3.org/2001/XMLSchema};in", values.get(0));
52 }
53 }