diff options
author | 2018-02-09 17:18:14 +0800 | |
---|---|---|
committer | 2018-02-09 17:18:14 +0800 | |
commit | f5c915d621d3038a0b7aaf65a6885645865e8192 (patch) | |
tree | 4486c2ead095459c34e299f391e325555ade6bd3 /ResmanagementService | |
parent | 0842892840c6efb7849e3c7c0ec4fa2529700b12 (diff) |
Add UT for NsEntity
Change-Id: Ie1cdb7487b8fcc3b772c85644ffb17e31b26a2c4
Issue-ID: VFC-747
Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'ResmanagementService')
-rw-r--r-- | ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/entity/NsEntityTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/entity/NsEntityTest.java b/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/entity/NsEntityTest.java index b1d03f5..0503c80 100644 --- a/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/entity/NsEntityTest.java +++ b/ResmanagementService/service/src/test/java/org/onap/vfc/nfvo/resmanagement/service/entity/NsEntityTest.java @@ -16,6 +16,7 @@ package org.onap.vfc.nfvo.resmanagement.service.entity;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
@@ -43,7 +44,20 @@ public class NsEntityTest { nsEntity.setLastUpdate("lastUpdate");
nsEntity.setResourceVersion("resourceVersion");
assertTrue(nsEntity.toString() != null);
- assertTrue(nsEntity.toEntity(new JSONObject()) != null);
+ assertNotNull(nsEntity.toEntity(new JSONObject()));
+ assertNotNull(nsEntity.toStringForAai());
+ }
+ @Test
+ public void testToStringForAai() {
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("service-instance-id", "service-instance-id");
+ jsonObject.put("service-instance-name", "service-instance-name");
+ jsonObject.put("description", "description");
+ jsonObject.put("orchestration-status", "orchestration-status");
+ jsonObject.put("created-at", "created-at");
+ jsonObject.put("updated-at", "updated-at");
+ jsonObject.put("resource-version", "resource-version");
+ assertNotNull(nsEntity.toEntityFromAai(jsonObject));
}
}
|