简体   繁体   English

如何在Mule单元测试中伪造SFTP服务器?

[英]How to fake SFTP server on Mule unit test?

I'm trying to unit test a mule flow that has an ftp:inbound-endpoint and an sftp:outbound-endpoint. 我正在尝试对具有ftp:inbound-endpoint和sftp:outbound-endpoint的m子流进行单元测试。

I'm following the example FTPFunctionalTestCase from Mule In Action 2nd Ed chapter 03, which has both an ftp:inbound-endpoint and an ftp:outbound-endpoint. 我遵循的是《 Mule In Action》第二版第03章中的示例FTPFunctionalTestCase,它同时具有ftp:inbound-endpoint和ftp:outbound-endpoint。

The point is that I'm not able to use FakeFtpServer for faking an SFTP server. 关键是我无法使用FakeFtpServer伪造SFTP服务器。 Is there any trick I don't know for doing it, or should I use another class? 有什么我不知道的技巧,还是应该使用其他课程?

FakeFtpServer does not provide SFTP, as it is a quite different technology from FTP. FakeFtpServer不提供SFTP,因为它是与FTP完全不同的技术。 You might want to look at Mule endpoint mocking with Munit , or if you really need a mock SFTP server, you can look at this blog post on building one. 您可能想要查看使用Munit进行的Mule端点模拟 ,或者如果您确实需要模拟SFTP服务器,则可以查看有关构建一个SFTP服务器的博客文章

Munit also provides an FTP/SFTP server for your integration tests Munit还为您的集成测试提供了一个FTP / SFTP服务器

https://github.com/mulesoft/munit/wiki/ftp-server https://github.com/mulesoft/munit/wiki/ftp-server

You need to go to the update site for munit and install SFTP integration tool in your Anypoint studio. 您需要访问munit的更新站点,并在Anypoint Studio中安装SFTP集成工具。 Then you will be able to use SFTP integration testing tool. 然后,您将可以使用SFTP集成测试工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM