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=5c1cc140ee0235d01ee0fd2fcebf86a32a7feb2c;hb=4db5e7d262aaa8ccf18feaa4bd93a6a925801333;hp=6fd6c8b95cf479ac39d1cc91fdf549c47aeb79e3;hpb=c5c251953f36a3a56613ad28f2d73f958ff58295;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 6fd6c8b9..5c1cc140 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 @@ -36,19 +36,21 @@ import reactor.test.StepVerifier; @ExtendWith(MockitoExtension.class) public 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