【问题标题】:Munit 2.1 mock a Map response and reference it as fileMunit 2.1 模拟 Map 响应并将其作为文件引用
【发布时间】:2020-08-31 20:08:31
【问题描述】:

如果我想引用文件,如何在 munit2 中模拟 Map 响应。例如在 db 连接器中。我试过了

#[MunitTools::resultOfScript('mockExamples/singleStudentGet.groovy')]

#[resultOfScript('mockExamples/singleStudentGet.groovy')]

后者曾经在munit1.2工作,但在munit2不工作。

请帮忙。

【问题讨论】:

    标签: mule mule4 munit


    【解决方案1】:

    MUnit 2.x 似乎不支持使用 resultOfScript()。作为替代方案,您可以将 Groovy 脚本迁移到 DataWeave 脚本。有关如何在 MUnit 2 中使用 DataWeave 脚本的示例,请参阅https://docs.mulesoft.com/munit/2.2/mock-file-cookbook#mocking-files-using-variables-in-a-dataweave-module 的文档。

    【讨论】:

    • 这有帮助。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-06
    • 1970-01-01
    相关资源
    最近更新 更多