标签: munit

在Mulesoft中为APIKit设置MUnit流参考的入站属性

我正在尝试在MUnit中测试APIKit.最初我在MUnit中使用http请求来调用我的流,然后APIKit将请求路由到我的逻辑所在的正确子流.现在我想模拟子流的一个元素,所以我试图用APIKit流的引用替换http请求.这有效,但APIKit路由器抛出错误:

Cannot resolve request base path
Run Code Online (Sandbox Code Playgroud)

因为没有设置入站属性.这是我的问题,我如何模仿我发送到流参考的入站属性,以便请求看起来像来自HTTP请求?或者,有没有其他方法可以构造代码,以便我可以模拟我的逻辑元素?

谢谢

mule mule-studio munit anypoint-studio

2
推荐指数
1
解决办法
4008
查看次数

在M子中模拟子流

我正在尝试为以下流程创建MUnit。

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <db:oracle-config name="Oracle_Configuration" host="127.0.0.1" port="1521" instance="xe" user="system" password="madhu" doc:name="Oracle Configuration"/>
    <flow name="munitFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/munit" doc:name="HTTP"/>
        <object-to-string-transformer doc:name="Object to String"/>
        <set-payload value="#[payload]" doc:name="Set Payload"/>
        <flow-ref name="SubFlow1" doc:name="SubFlow1"/>
        <choice doc:name="Choice">
            <when expression="#[flowVars.temp == '1']">
                <set-payload value="Hello from madhu" doc:name="Set Payload"/>
            </when>
            <otherwise>
                <set-payload value="Hello from mitha" doc:name="Set Payload"/>
            </otherwise>
        </choice>
    </flow>
    <sub-flow name="SubFlow1"> …
Run Code Online (Sandbox Code Playgroud)

mule munit

0
推荐指数
1
解决办法
2232
查看次数

标签 统计

mule ×2

munit ×2

anypoint-studio ×1

mule-studio ×1