tweetExceptionHandler.setExceptionsRemaining(3);
commandExecutor.execute(new Command<String>() {
public String execute(CommandContext commandContext) {
MessageEntity message = createTweetExceptionMessage();
commandContext.getJobEntityManager().send(message);
return message.getId();
}
});
Job job = managementService.createJobQuery().singleResult();
assertEquals(3, job.getRetries());