TimeoutSensitiveLockRpcClient implements LockRpcClient { @Override public long currentTimeMillis(String namespace) { return shortTimeoutProxy.currentTimeMillis(namespace); } TimeoutSensitiveLockRpcClient(ShortAndLongTimeoutServices<LockRpcClient> services); @Override Optional<LockResponse> lockWithFullLockResponse(String namespace, LockClient client, LockRequest request); @Override boolean unlock(String namespace, HeldLocksToken token); @Override boolean unlock(String namespace, LockRefreshToken token); @Override boolean unlockSimple(String namespace, SimpleHeldLocksToken token); @Override boolean unlockAndFreeze(String namespace, HeldLocksToken token); @Override Set<HeldLocksToken> getTokens(String namespace, LockClient client); @Override Set<HeldLocksToken> refreshTokens(String namespace, Iterable<HeldLocksToken> tokens); @Override Optional<HeldLocksGrant> refreshGrant(String namespace, HeldLocksGrant grant); @Override Optional<HeldLocksGrant> refreshGrant(String namespace, BigInteger grantId); @Override HeldLocksGrant convertToGrant(String namespace, HeldLocksToken token); @Override HeldLocksToken useGrant(String namespace, LockClient client, HeldLocksGrant grant); @Override HeldLocksToken useGrant(String namespace, LockClient client, BigInteger grantId); @Override Optional<Long> getMinLockedInVersionId(String namespace); @Override Optional<Long> getMinLockedInVersionId(String namespace, LockClient client); @Override Optional<Long> getMinLockedInVersionId(String namespace, String client); @Override LockServerOptions getLockServerOptions(String namespace); @Override Optional<LockRefreshToken> lock(String namespace, String client, LockRequest request); @Override Optional<HeldLocksToken> lockAndGetHeldLocks(String namespace, String client, LockRequest request); @Override Set<LockRefreshToken> refreshLockRefreshTokens(String namespace, Iterable<LockRefreshToken> tokens); @Override long currentTimeMillis(String namespace); @Override void logCurrentState(String namespace);  }
@Test public void currentTimeMillisHasShortTimeout() { sensitiveClient.currentTimeMillis(NAMESPACE); verify(shortTimeout).currentTimeMillis(NAMESPACE); verify(longTimeout, never()).currentTimeMillis(NAMESPACE); }