Citrusframework:验证 http 服务器没有再收到任何请求

Citrusframework: Verify that http server has not received any more requests

在我的测试用例中,我对 citrus http 服务器的每个预期请求执行 http().receive() 操作。

现在我想确认在预期的请求之后没有更多的请求。我该如何实现?

您可以使用 receiveTimeout() 测试操作,期望在给定端点上没有收到任何消息:

receiveTimeout(httpServer)
    .timeout(5000);

这将确保在 5000 毫秒内没有收到来自 'httpServer' 端点的请求。如果消息在那个时间到达此端点,则操作失败。