Sérgio Abreu
Sérgio Abreu

Reputation: 177

FunctionalTestCase Mule 3.6.0

I'm migrating my FunctionalTestCase from Mule 3.5.0 to Mule 3.6.0, when I try to post a json like:

Map properties = new HashMap(); 
properties.put("Content-Type", "application/json"); 
properties.put("http.method", "POST"); 
muleMessage.addProperties(properties, PropertyScope.OUTBOUND); 
AbstractMuleContextTestCase.muleContext.getClient().send(url, muleMessage); 

I always get NullPayload in the flow that I'm testing, how it's the proper way to do a post in the new version of Mule 3.6.0

Upvotes: 1

Views: 185

Answers (1)

afelisatti
afelisatti

Reputation: 2835

MuleClient has a new method now to specify the request options, including the method to be used. This is: send(String url, MuleMessage message, OperationOptions operationOptions). The operationOptions can be created in many ways, one of which is: newOptions().method("POST").build() to make a POST request.

An example of this can be found here in testHttpRedeliveryExhaustedRollbackUsingMuleClient.

Upvotes: 3

Related Questions