@Test public void testSuccessWithoutRun() { try { callback.success(); fail("Expected IllegalStateException"); } catch (IllegalStateException e) { } verify(mockTimer, never()).update(anyLong(), any(TimeUnit.class)); }
@Override public void success() { Preconditions.checkState(state != State.STOPPED, "state is STOPPED"); pause(); commitTimer.update(elapsedTime, TimeUnit.NANOSECONDS); state = State.STOPPED; }
TransactionRateLimitingCallback implements OperationCallback { @Override public void success() { Preconditions.checkState(state != State.STOPPED, "state is STOPPED"); pause(); commitTimer.update(elapsedTime, TimeUnit.NANOSECONDS); state = State.STOPPED; } }
TransactionRateLimitingCallback implements OperationCallback { @Override public void success() { Preconditions.checkState(state != State.STOPPED, "state is STOPPED"); pause(); commitTimer.update(elapsedTime, TimeUnit.NANOSECONDS); state = State.STOPPED; } TransactionRateLimitingCallback(ActorUtils actorUtils); }
TransactionRateLimitingCallback implements OperationCallback { @Override public void success() { Preconditions.checkState(state != State.STOPPED, "state is STOPPED"); pause(); commitTimer.update(elapsedTime, TimeUnit.NANOSECONDS); state = State.STOPPED; } TransactionRateLimitingCallback(ActorUtils actorUtils); @Override void run(); @Override void pause(); @Override void resume(); @Override void success(); @Override void failure(); }
TransactionRateLimitingCallback implements OperationCallback { @Override public void success() { Preconditions.checkState(state != State.STOPPED, "state is STOPPED"); pause(); commitTimer.update(elapsedTime, TimeUnit.NANOSECONDS); state = State.STOPPED; } TransactionRateLimitingCallback(ActorUtils actorUtils); @Override void run(); @Override void pause(); @Override void resume(); @Override void success(); @Override void failure();  }