@Test(expected = CounterCapacityException.class)
public void shouldNotIncrementIfUsageIsAboveLimitAndShardsHaveExcessUsage() throws IOException {

  // init counter
  assertEquals(0, shardedCounter.getCounter(COUNTER_ID1));
  updateLimitInStorage(COUNTER_ID1, 1);
  // Update second shard despite limit being set to 1, possible if users decrease resource limit
  updateShard(COUNTER_ID1, 1, 1);
  // Invalidate snapshot to force pull changes from Datastore emulator
  shardedCounter.inMemSnapshot.invalidate(COUNTER_ID1);
  // assert cache is updated with the new value
  assertEquals(1L, shardedCounter.getCounter(COUNTER_ID1));
  updateCounterInTransaction(COUNTER_ID1, 1L);
}