@Test
public void receiveShouldLogFailure() throws Exception {

  final Exception cause = new Exception("fubared");
  reset(storage);
  when(storage.runInTransactionWithRetries(any())).thenThrow(cause);
  final Event event = Event.started(INSTANCE);
  try {
    stateManager.receive(event, 4711L);
    fail();
  } catch (Exception ignore) {
  }
  verify(logger).debug(
      "Failed workflow instance transition: {}, counter={}",
      event, 4711L, cause);
}