@Test
public void shouldFailToStoreWorkflow() throws Exception {

  doThrow(new IOException("write error")).when(transaction).store(HOURLY_WORKFLOW);
  when(transaction.workflow(HOURLY_WORKFLOW.id())).thenReturn(Optional.of(HOURLY_WORKFLOW));
  try {
    workflowInitializer.store(HOURLY_WORKFLOW, PASS);
    fail();
  } catch (RuntimeException e) {
    assertEquals("write error", e.getCause().getMessage());
  }
}