【发布时间】:2015-04-02 17:45:04
【问题描述】:
我有一个流程,我正在尝试使用 Munit 在 Mule 中测试一个基本的 HTTP 流程,流程看起来像这样:
<flow name="health-checkFlow">
<http:listener config-ref="HTTP_Listener_Configuration"
path="/" allowedMethods="GET" doc:name="HTTP">
<http:response-builder />
</http:listener>
....
</flow>
我使用 Munit 调用流程:
MuleEvent resultEvent = runFlow("health-checkFlow", testEvent(""));
resultEvent 对象具有正确的有效负载,但是当我尝试使用以下方法获取 http 响应代码时:
assertEquals("HTTP status code should be 200","200",resultEvent.getMessage().getOutboundProperty("http.status"));
状态始终为空。如何从 Munit 中的消息中获取 http 响应码?
【问题讨论】: