Merge "Added STD sim 2.0.0 tests"
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / repository / LockTest.java
index ee7e04f..4b8743f 100644 (file)
@@ -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();
@@ -64,11 +65,11 @@ public class LockTest {
         lock.lockBlocking(LockType.SHARED);
         lock.unlockBlocking();
 
-        assertThat(lock.getLockCounter()).isEqualTo(0);
+        assertThat(lock.getLockCounter()).isZero();
     }
 
     @Test
-    public void testReactiveLock() {
+    void testReactiveLock() {
         Lock lock = new Lock();
 
         Mono<Lock> seq = lock.lock(LockType.EXCLUSIVE) //
@@ -81,7 +82,7 @@ public class LockTest {
             .expectNext(lock) //
             .verifyComplete();
 
-        assertThat(lock.getLockCounter()).isEqualTo(0);
+        assertThat(lock.getLockCounter()).isZero();
 
     }