@Test
public void testRetryStrategyHold() throws Exception {

  WorkflowDefinitionImpl def = new WorkflowDefinitionImpl();
  def.setId("workflow-definition-1");
  def.setTitle("workflow-definition-1");
  def.setDescription("workflow-definition-1");
  WorkflowOperationDefinitionImpl opDef = new WorkflowOperationDefinitionImpl("failOneTime", "fails once", null, true);
  opDef.setRetryStrategy(RetryStrategy.HOLD);
  opDef.setMaxAttempts(2);
  def.add(opDef);
  MediaPackage mp = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().createNew();
  WorkflowInstance workflow = startAndWait(def, mp, WorkflowState.PAUSED);
  WorkflowOperationInstance errorResolutionOperation = service.getWorkflowById(workflow.getId()).getOperations()
          .get(0);
  WorkflowOperationInstance failOneTimeOperation = service.getWorkflowById(workflow.getId()).getOperations().get(1);
  Assert.assertTrue(errorResolutionOperation.getTemplate().equals(WorkflowServiceImpl.ERROR_RESOLUTION_HANDLER_ID));
  Assert.assertTrue(errorResolutionOperation.getState() == OperationState.PAUSED);
  Assert.assertTrue(errorResolutionOperation.getFailedAttempts() == 0);
  Assert.assertTrue(failOneTimeOperation.getState() == OperationState.RETRY);
  Assert.assertTrue(failOneTimeOperation.getMaxAttempts() == 2);
  Assert.assertTrue(failOneTimeOperation.getFailedAttempts() == 1);
}