@Test
public void throwExceptionWhenFailedToReadEvents() throws Exception {

  IOException exception = new IOException();
  when(storage.readEvents(WORKFLOW_INSTANCE)).thenThrow(exception);
  try {
    ReplayEvents.getBackfillRunStateData(WORKFLOW_INSTANCE, storage, "bf-1");
    fail();
  } catch (RuntimeException e) {
    assertThat(e.getCause(), is(exception));
  }
}