【发布时间】:2017-09-26 10:23:57
【问题描述】:
有没有人使用 MUnit 和 SFTP 组件,你能提供任何有用的信息/示例来启动吗? 我浏览了 MUnit 文档,但在 Munit 的 SFTP 组件上没有得到太多帮助。
【问题讨论】:
有没有人使用 MUnit 和 SFTP 组件,你能提供任何有用的信息/示例来启动吗? 我浏览了 MUnit 文档,但在 Munit 的 SFTP 组件上没有得到太多帮助。
【问题讨论】:
使用 Munit FTP 服务器。启用安全属性 true 以使用 SFTP 。请参考本页https://docs.mulesoft.com/munit/v/1.2.0/munit-ftp-server。
在套件运行之前启动服务器,之后停止服务器。示例如下。
<ftpserver:config name="FTP_Server" secure="true" doc:name="FTP Server"/>
<munit:before-suite name="suiteBefore" description="MUnit Test">
<ftpserver:start-server config-ref="FTP_Server" doc:name="FTP Server"/>
</munit:before-suite>
<munit:test name="FlowTest" description="Test">
--flow test goes here----
<flow-ref name="test5Flow" doc:name="Flow-ref to test5Flow"/>
<ftpserver:contains-files config-ref="FTP_Server" file="testFile.xml" path="/tmp" doc:name="FTP Server"/>
</munit:test>
<munit:after-suite name="After_Suite" description="After suite actions">
<ftpserver:stop-server config-ref="FTP_Server" doc:name="FTP Server"/>
</munit:after-suite>
【讨论】:
在 Anypoint Studio 中,转到帮助并安装新软件...。 在 Work with: 面板中查找 MUnit Update Site,然后从 MUnit Tools for Mule 部分中,选择 FTP server Module (Mule 3.4.0+) 然后您将获取 ftp server 的 munit 组件。您可以在before/after 套件来处理数据转换以测试应用程序,您可以将其用作应用程序单元流的出站。
【讨论】: