aboutsummaryrefslogtreecommitdiffstats
path: root/feature-server-pool/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-26 12:49:43 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-26 12:49:43 +0000
commita8cdf564ed34a2ec155a7c5f34392130f36ce877 (patch)
tree08309619a772ca48f1c813b1d507519df8f4d903 /feature-server-pool/src
parent07634512d580fa9e14c34751fd42b51bf9b17a63 (diff)
parent222d685035033f8c61f0ae1e31ce37b2068bb2a0 (diff)
Merge "replace Thread sleep with Awaitility"
Diffstat (limited to 'feature-server-pool/src')
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java2
-rw-r--r--feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java4
2 files changed, 2 insertions, 4 deletions
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
index 789dfe61..044067a3 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpool/AdapterImpl.java
@@ -175,7 +175,7 @@ public class AdapterImpl extends Adapter {
for (int i = 0; i < Bucket.BUCKETCOUNT; i += 1) {
Bucket bucket = Bucket.getBucket(i);
while (bucket.getOwner() == null) {
- Thread.sleep(Math.min(endTime - System.currentTimeMillis(), 100L));
+ await().atMost(Math.min(endTime - System.currentTimeMillis(), 100L), TimeUnit.MILLISECONDS);
}
}
} catch (IllegalArgumentException e) {
diff --git a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
index 436cf77f..fe525788 100644
--- a/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
+++ b/feature-server-pool/src/test/java/org/onap/policy/drools/serverpooltest/Test1.java
@@ -181,9 +181,7 @@ public class Test1 {
UUID leaderUuid = firstAdapter.getLeader().getUuid();
for (Adapter adapter : Adapter.adapters) {
UUID uuid = adapter.getLeader().getUuid();
- assertTrue(adapter.toString() + " has UUID " + uuid
- + " (expected UUID " + leaderUuid + ")",
- uuid.equals(leaderUuid));
+ assertEquals(adapter.toString(), leaderUuid, uuid);
}
}