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=2b05f15336c57960af51e3a6cbf5705b6b88c4fd;hp=6fd6c8b95cf479ac39d1cc91fdf549c47aeb79e3;hpb=5408c157fc8aca52731fcc2cc035ed9dbfcff219;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