aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/aai/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-09-21 09:31:25 -0400
committerJim Hahn <jrh3@att.com>2018-09-21 10:12:52 -0400
commitd85e766c5538de762820132ac723d928f5a9bf89 (patch)
tree738c4de12a3a261035bbb25199558a490d550d3e /controlloop/common/model-impl/aai/src/test
parentfaf283066f186838665ed5c38c1ba8319041bc1c (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/aai/src/test')
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java
index 9acaa117c..d1e8e964e 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java
@@ -22,7 +22,7 @@ package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -207,41 +207,38 @@ public class AaiNqResponseWrapperTest {
// null item
resp = new AaiNqResponseWrapper();
- assertNull(resp.getVfModuleItems(true));
+ assertTrue(resp.getVfModuleItems(true).isEmpty());
// missing item
resp = new AaiNqResponseWrapper();
resp.setAaiNqResponse(new AaiNqResponse());
- assertNull(resp.getVfModuleItems(false));
+ assertTrue(resp.getVfModuleItems(false).isEmpty());
// null item list
resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoItems.json"));
resp.getAaiNqResponse().getInventoryResponseItems().get(0).getItems().getInventoryResponseItems().get(0)
.getItems().setInventoryResponseItems(null);
- assertNull(resp.getVfModuleItems(false));
+ assertTrue(resp.getVfModuleItems(false).isEmpty());
// no modules
resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoModules.json"));
- assertNull(resp.getVfModuleItems(false));
+ assertTrue(resp.getVfModuleItems(false).isEmpty());
// no names
resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoNames.json"));
List<AaiNqInventoryResponseItem> lst;
lst = resp.getVfModuleItems(false);
- assertNotNull(lst);
assertEquals(0, lst.size());
// base VF modules
resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json"));
lst = resp.getVfModuleItems(true);
- assertNotNull(lst);
assertEquals(1, lst.size());
assertEquals("Vfmodule_vLBMS-0809-1", lst.get(0).getVfModule().getVfModuleName());
// non base VF modules
resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json"));
lst = resp.getVfModuleItems(false);
- assertNotNull(lst);
assertEquals(3, lst.size());
int index;
index = 0;