X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Frepository%2FLockTest.java;h=fd75978566a5671f7f3972f830838f30f6141193;hb=2310d1c6a458bd12b2d1ff805f1bd12dcd536cfa;hp=ee7e04fd672afd03baa8dd344050fc510b1eea42;hpb=d898170a0bb639b85a7f8770ddab2a3ccd181cfb;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/repository/LockTest.java b/policy-agent/src/test/java/org/oransc/policyagent/repository/LockTest.java index ee7e04fd..fd759785 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/repository/LockTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/repository/LockTest.java @@ -34,26 +34,27 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @ExtendWith(MockitoExtension.class) -public class LockTest { +class LockTest { @SuppressWarnings("squid:S2925") // "Thread.sleep" should not be used in tests. private void sleep() { try { Thread.sleep(100); } catch (InterruptedException e) { + // Do nothing. } } private void asynchUnlock(Lock lock) { - Thread t = new Thread(() -> { + Thread thread = new Thread(() -> { sleep(); lock.unlockBlocking(); }); - t.start(); + thread.start(); } @Test - public void testLock() throws IOException, ServiceException { + void testLock() throws IOException, ServiceException { Lock lock = new Lock(); lock.lockBlocking(LockType.SHARED); lock.unlockBlocking(); @@ -68,7 +69,7 @@ public class LockTest { } @Test - public void testReactiveLock() { + void testReactiveLock() { Lock lock = new Lock(); Mono seq = lock.lock(LockType.EXCLUSIVE) //