use of net.javacrumbs.shedlock.support.StorageBasedLockProvider in project ShedLock by lukas-krecan.
the class AbstractStorageBasedLockProviderIntegrationTest method lockShouldSurviveCacheClearingInTheMiddle.
@Test
public void lockShouldSurviveCacheClearingInTheMiddle() {
StorageBasedLockProvider provider = getLockProvider();
LockConfiguration configuration = lockConfig(LOCK_NAME1);
Optional<SimpleLock> lock = provider.lock(configuration);
assertThat(lock).isPresent();
provider.clearCache();
// lock is still locked
assertThat(provider.lock(lockConfig(LOCK_NAME1))).isEmpty();
lock.get().unlock();
}
Aggregations