- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 MUnit 中测试 APIKit。最初我在 MUnit 中使用 http 请求来调用我的流,然后 APIKit 会将请求路由到我的逻辑所在的正确子流。现在我想模拟子流的元素之一,所以我试图用对 APIKit 流的引用替换 http 请求。这有效,但 APIKit 路由器抛出错误:
Cannot resolve request base path
因为没有设置入站属性。这是我的问题,我如何模拟发送到流引用的入站属性,以便请求看起来像是来自 HTTP 请求?或者,是否有另一种方法可以构建代码,以便我可以模拟我的逻辑元素?
谢谢
最佳答案
您可以在您的模拟 http 响应中添加属性。请参见下面的示例:
<mock:when messageProcessor=".*:.*" doc:name="Queue Message">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['Queue Message']"/>
</mock:with-attributes>
<mock:then-return payload="#['Sample response']">
<mock:inbound-properties>
<mock:inbound-property key="prop1" value="val1"/>
<mock:inbound-property key="prop2" value="val2"/>
</mock:inbound-properties>
</mock:then-return>
</mock:when>
希望对你有帮助
关于mule - 为 APIKit 的 Mulesoft 中的 MUnit 流引用设置入站属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307478/
在 Mule 中使用 APIKit,如果在执行我的流程时未找到特定资源,我需要返回 404 状态代码。 我可以看到三种处理方法: 抛出自定义业务异常(使用 groovy 脚本),即 PersonNot
可以在一个 APIKit Mule 项目中使用多个 RAML 文件吗? 假设我有两个函数/api/func1 和/api/func2。 每个函数都在自己的 raml 中定义 - func1.raml
**问题已解决,感谢 neildo。以下是从 POST 获得响应所需要的 RAML 文件必须具有响应正文定义 HTTP 端点必须设置为请求-响应 使用同步处理策略的所有流 Accept 和 Conte
我已经为通过 APIKit 路由器生成的流创建了 Munit 测试用例。但是在运行测试套件时,我遇到了以下异常: Exception in thread "main" java.lang.Runtim
我使用带有 APIKit + RAML 的 Mule 3.7。缺少有关 mule 的 http 响应构建器等的文档。 Http Credentials 不适用于 Access-Control-Allo
我正在尝试在 MUnit 中测试 APIKit。最初我在 MUnit 中使用 http 请求来调用我的流,然后 APIKit 会将请求路由到我的逻辑所在的正确子流。现在我想模拟子流的元素之一,所以我试
我是一名优秀的程序员,十分优秀!