Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Updated function test env with new tests and features"
[nonrtric.git]
/
policy-agent
/
src
/
test
/
java
/
org
/
oransc
/
policyagent
/
repository
/
LockTest.java
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
6fd6c8b
..
fd75978
100644
(file)
--- 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,25
+34,27
@@
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
@ExtendWith(MockitoExtension.class)
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) {
private void sleep() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
+ // Do nothing.
}
}
private void asynchUnlock(Lock lock) {
}
}
private void asynchUnlock(Lock lock) {
- Thread t = new Thread(() -> {
+ Thread t
hread
= new Thread(() -> {
sleep();
lock.unlockBlocking();
});
sleep();
lock.unlockBlocking();
});
- t.start();
+ t
hread
.start();
}
@Test
}
@Test
-
public
void testLock() throws IOException, ServiceException {
+ void testLock() throws IOException, ServiceException {
Lock lock = new Lock();
lock.lockBlocking(LockType.SHARED);
lock.unlockBlocking();
Lock lock = new Lock();
lock.lockBlocking(LockType.SHARED);
lock.unlockBlocking();
@@
-67,7
+69,7
@@
public class LockTest {
}
@Test
}
@Test
-
public
void testReactiveLock() {
+ void testReactiveLock() {
Lock lock = new Lock();
Mono<Lock> seq = lock.lock(LockType.EXCLUSIVE) //
Lock lock = new Lock();
Mono<Lock> seq = lock.lock(LockType.EXCLUSIVE) //