@Test
public void shouldFailToUpdateResourceCountersOnDequeueDueToConflict() throws Exception {

  givenState(INSTANCE, State.QUEUED);
  var rootCause = new DatastoreIOException(new DatastoreException(10, "conflict!", "conflict!"));
  doThrow(rootCause).when(transaction).updateCounter(shardedCounter, "resource1", 1);
  var dequeueEvent = Event.dequeue(INSTANCE, Set.of("resource1"));
  exception.expect(RuntimeException.class);
  exception.expectCause(is(rootCause));
  stateManager.receive(dequeueEvent);
}