SimpleJdbcLock extends AbstractSimpleLock { @Override protected boolean refresh(final String key, final String storeId, final String token, final long expiration) { return lockSingleKeyService.refresh(key, storeId, token, expiration); } SimpleJdbcLock(final Supplier<String> tokenSupplier, final JdbcLockSingleKeyService lockSingleKeyService);   }
@Test public void shouldNotRefreshBecauseKeyExpired() { final var keys = Collections.singletonList("1"); assertThat(lock.refresh(keys, "locks", "abc", 1000)).isFalse(); assertThat(jdbcTemplate.queryForList("SELECT * FROM locks")).isNullOrEmpty(); }