@Test
public void shouldFailTriggerOnExceptionFromTransaction() throws Exception {

  reset(storage);
  when(storage.getLatestStoredCounter(any())).thenReturn(Optional.empty());
  var cause = new IOException("fail!");
  when(storage.runInTransactionWithRetries(any())).thenThrow(cause);
  exception.expectCause(is(cause));
  stateManager.trigger(INSTANCE, TRIGGER1, PARAMETERS);
}