diff options
author | Jim Hahn <jrh3@att.com> | 2018-09-21 09:31:25 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2018-09-21 10:12:52 -0400 |
commit | d85e766c5538de762820132ac723d928f5a9bf89 (patch) | |
tree | 738c4de12a3a261035bbb25199558a490d550d3e /controlloop/common/model-impl/vfc | |
parent | faf283066f186838665ed5c38c1ba8319041bc1c (diff) |
new sonar issues in drools-applications
Don't return null lists from AAI.
Transient TargetLock.
Extract aai.url, et. al., constants.
Don't allocate extra unneeded variable.
Re-order fields in xacml attributes.
Extract "vserver" constant from simulator.
Replace thread sleep with join.
Change-Id: Iee1bd182862632af1f131cca5db5b526f5865b9f
Issue-ID: POLICY-1129
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/model-impl/vfc')
-rw-r--r-- | controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestVfcManager.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestVfcManager.java b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestVfcManager.java index 9913d39b8..7e4bda81d 100644 --- a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestVfcManager.java +++ b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestVfcManager.java @@ -189,9 +189,7 @@ public class TestVfcManager { anyString())) .thenThrow(new RuntimeException("OzException")); - while (managerThread.isAlive()) { - Thread.sleep(100); - } + managerThread.join(); PolicyEngine.manager.getEnvironment().remove("vfc.password"); PolicyEngine.manager.getEnvironment().remove("vfc.username"); @@ -214,9 +212,7 @@ public class TestVfcManager { eq("Dorothy"), eq("Null"), anyMap(), anyString(), anyString())) .thenReturn(null); - while (managerThread.isAlive()) { - Thread.sleep(100); - } + managerThread.join(); PolicyEngine.manager.getEnvironment().remove("vfc.password"); PolicyEngine.manager.getEnvironment().remove("vfc.username"); @@ -239,9 +235,7 @@ public class TestVfcManager { eq("Dorothy"), eq("Error0"), anyMap(), anyString(), anyString())) .thenReturn(httpResponseErr); - while (managerThread.isAlive()) { - Thread.sleep(100); - } + managerThread.join(); PolicyEngine.manager.getEnvironment().remove("vfc.password"); PolicyEngine.manager.getEnvironment().remove("vfc.username"); @@ -264,9 +258,7 @@ public class TestVfcManager { eq("Dorothy"), eq("OK"), anyMap(), anyString(), anyString())) .thenReturn(httpResponseBadResponse); - while (managerThread.isAlive()) { - Thread.sleep(100); - } + managerThread.join(); PolicyEngine.manager.getEnvironment().remove("vfc.password"); PolicyEngine.manager.getEnvironment().remove("vfc.username"); @@ -292,9 +284,7 @@ public class TestVfcManager { when(mockedRestManager.get(endsWith("1234"), eq("Dorothy"), eq("OK"), anyMap())) .thenReturn(httpResponseGetOk); - while (managerThread.isAlive()) { - Thread.sleep(100); - } + managerThread.join(); PolicyEngine.manager.getEnvironment().remove("vfc.password"); PolicyEngine.manager.getEnvironment().remove("vfc.username"); |