summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java4
-rw-r--r--src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java13
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java
index bdac01d..d2d1670 100644
--- a/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java
+++ b/src/test/java/org/onap/dcae/inventory/dbthings/mappers/DCAEServiceTypeObjectMapperTests.java
@@ -102,6 +102,10 @@ public class DCAEServiceTypeObjectMapperTests {
}
});
TestCase.assertNotNull(mapper.map(0, resultSet, null));
+
+ when(resultSet.getArray("service_ids")).thenReturn(null);
+ when(resultSet.getArray("service_locations")).thenReturn(null);
+ TestCase.assertNotNull(mapper.map(0, resultSet, null));
} catch (Exception e) {
fail("Unexpected exception");
}
diff --git a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java
index 1d80059..b4fe644 100644
--- a/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java
+++ b/src/test/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceComponentObjectTests.java
@@ -23,6 +23,7 @@ package org.onap.dcae.inventory.dbthings.models;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
@@ -69,4 +70,16 @@ public class DCAEServiceComponentObjectTests {
assertNotSame(objectUpdated.getModified(), objectFirst.getModified());
}
+ @Test
+ public void testToString() {
+ DCAEServiceComponentRequest request = (new DCAEServiceComponentRequest()).componentId("some-component-id")
+ .componentType("scary-component-type");
+ request.setComponentSource("controller");
+ request.setShareable(0);
+
+ DCAEServiceComponentObject object = new DCAEServiceComponentObject(request);
+ String stringObject = object.toString();
+ assertTrue(stringObject.contains("componentId"));
+ }
+
}