use of com.amazonaws.services.simpleworkflow.model.DecisionTask in project camel by apache.
the class CamelSWFWorkflowConsumerTest method receivesDecisionTask.
@Test
public void receivesDecisionTask() throws Exception {
// use minimum as depending on the polling we may do more than 1 in the test before we assert and stop
result.expectedMinimumMessageCount(1);
result.expectedMessagesMatches(new Predicate() {
public boolean matches(Exchange exchange) {
return exchange.getIn().getHeader(SWFConstants.ACTION) != null;
}
});
DecisionTask decisionTask = new DecisionTask();
decisionTask.setTaskToken("token");
when(amazonSWClient.pollForDecisionTask(any(PollForDecisionTaskRequest.class))).thenReturn(decisionTask);
context.start();
assertMockEndpointsSatisfied();
verify(amazonSWClient, atLeastOnce()).pollForDecisionTask(any(PollForDecisionTaskRequest.class));
}
Aggregations