@Test
public void testRetryStrategyRetry() 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.RETRY);
  def.add(opDef);
  MediaPackage mp = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().createNew();
  WorkflowInstance workflow = startAndWait(def, mp, WorkflowState.SUCCEEDED);
  Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getState() == OperationState.SUCCEEDED);
  Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getMaxAttempts() == 2);
  Assert.assertTrue(service.getWorkflowById(workflow.getId()).getOperations().get(0).getFailedAttempts() == 1);
}