34.6. assertPeriod の使用
アサーションが満たされると、Camel は assertIsSatisfied メソッドの待機を停止し、続行します。つまり、新しいメッセージがモックエンドポイント(後でのみ)に到達すると、アサーションの結果には影響を与えません。その後の期間後に新しいメッセージが到達しないことをテストする場合は、以下のように setAssertPeriod メソッドを設定してこれを実行できます。
MockEndpoint resultEndpoint = context.getEndpoint("mock:foo", MockEndpoint.class);
resultEndpoint.setAssertPeriod(5000);
resultEndpoint.expectedMessageCount(2);
// send some messages
// now lets assert that the mock:foo endpoint received 2 messages
resultEndpoint.assertIsSatisfied();