0

I need to write automated tests for Enterprise Service Bus (ESB). When ESB is running it performs different scheduled operations including DB queries, SOAP and TCP calls, etc. Also it periodically checks whether some services are active and stops flows in case it is not.

So in my case there will be some problems:

  • some flows will stop because service is not responding
  • another flows will continuously run in negative scenariuos producing errors

Is it possible to have mocks continuosly running while executing tests using Citrus Framework?

How else can I overcome this problems with Citrus?

4

1 回答 1

1

请注意,Citrus 中的所有服务器组件仅在执行测试时才有效。这是因为 Citrus 在测试套件之前/之后自动启动和停止服务器组件。当 Citrus 处于非活动状态时,服务器组件将停止。

如果您想打破这些限制,请查看citrus-simulator端项目,它是一个完整的独立模拟器,适用于不同的消息传输类型(尽管仍处于测试阶段)。

如果前面提到的限制对您来说没问题,那么您可以在 Citrus 项目的服务器组件上使用端点适配器的组合。你可以有一个静态端点适配器,它总是为传入的健康检查请求发送一个肯定的响应。

请参阅端点适配器的文档:http ://www.citrusframework.org/reference/html/endpoint-adapter.html

于 2017-04-14T12:40:41.267 回答