@Test
public void shouldStoreNewWorkflowAndUpdateNextNaturalTriggerWithOffset()
    throws IOException, WorkflowInitializationException {

  when(transaction.workflow(HOURLY_WORKFLOW_WITH_VALID_OFFSET.id())).thenReturn(Optional.empty());
  workflowInitializer.store(HOURLY_WORKFLOW_WITH_VALID_OFFSET, PASS);
  final Instant offsetNow = HOURLY_WORKFLOW_WITH_VALID_OFFSET.configuration().subtractOffset(NOW);
  final Instant nextTrigger = nextInstant(offsetNow, Schedule.HOURS);
  final Instant nextWithOffset = HOURLY_WORKFLOW_WITH_VALID_OFFSET.configuration().addOffset(nextTrigger);
  TriggerInstantSpec expectedTriggerInstantSpec = TriggerInstantSpec.create(nextTrigger, nextWithOffset);
  verify(transaction, never()).store(any(Workflow.class));
  verify(transaction, never()).updateNextNaturalTrigger(any(), any());
  verify(transaction).storeWorkflowWithNextNaturalTrigger(
      HOURLY_WORKFLOW_WITH_VALID_OFFSET, expectedTriggerInstantSpec);
}