226.4. assertPeriod 사용

Camel 2.7에서 사용 가능한
어설션이 충족되면 Camel이 대기를 중지하고 어설션 IsSatisfied 방법으로 계속 합니다. 즉, 새 메시지가 모크 끝점에 도착하면 잠시 후 도착은 어설션 결과에 영향을 미치지 않습니다. 그 후 일정 기간 후에 새 메시지가 도착했는지 테스트하려고 한다고 가정하면 setAssertPeriod 메서드를 설정하여 수행할 수 있습니다. 예를 들면 다음과 같습니다.

MockEndpoint resultEndpoint = context.resolveEndpoint("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();