FunctionalTestCase ule子3.6.0 [英] FunctionalTestCase Mule 3.6.0

查看:52
本文介绍了FunctionalTestCase ule子3.6.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试发布json时,我正在将我的FunctionalTestCase从Mule 3.5.0迁移到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); 

在测试的流程中,我总是会得到NullPayload,这是在新版Mule 3.6.0中发帖的正确方法

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

推荐答案

MuleClient现在有一个新方法来指定请求选项,包括要使用的方法.这是:send(String url, MuleMessage message, OperationOptions operationOptions).可以通过多种方式创建operationOptions,其中之一是:newOptions().method("POST").build()发出POST请求.

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.

这篇关于FunctionalTestCase ule子3.6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆