From c401a51179f66ad22b462320d2b680fc6e564fdd Mon Sep 17 00:00:00 2001
From: lizi00164331
Date: Wed, 20 Sep 2017 16:48:46 +0800
Subject: Add unit test for VNFM bean class.
Change-Id: Icdb9009bc343d1b931126df927684e8d8cb4cc3b
Issue-ID: AAI-351
Signed-off-by: lizi00164331
---
.../onap/aai/esr/entity/aai/EsrVnfmDetailTest.java | 69 ++++++++++++++++++++++
.../onap/aai/esr/entity/aai/EsrVnfmListTest.java | 35 +++++++++++
.../org/onap/aai/esr/entity/aai/EsrVnfmTest.java | 54 +++++++++++++++++
3 files changed, 158 insertions(+)
create mode 100644 esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java
create mode 100644 esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java
create mode 100644 esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmTest.java
(limited to 'esr-mgr/src')
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java
new file mode 100644
index 0000000..4dc4f0e
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmDetailTest.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.aai.esr.entity.aai;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+
+public class EsrVnfmDetailTest {
+ @Test
+ public void getterAndSetter4vnfmId(){
+ final String vnfmId = "vnfmId-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setVnfmId(vnfmId);
+ assertEquals(esrVnfm.getVnfmId(), vnfmId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion(){
+ final String resourceVersion = "resourceVersion-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setResourceVersion(resourceVersion);
+ assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4vimId(){
+ final String vimId = "vimId-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setVimId(vimId);
+ assertEquals(esrVnfm.getVimId(), vimId);
+ }
+
+ @Test
+ public void getterAndSetter4certificateUrl(){
+ final String certificateUrl = "certificateUrl-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setCertificateUrl(certificateUrl);
+ assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
+ }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoList(){
+ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ ArrayList esrSystemInfo = new ArrayList();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ esrSystemInfoObj.setEsrSystemInfoId("123");
+ esrSystemInfo.add(esrSystemInfoObj );
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ esrVnfmDetail.setEsrSystemInfoList(esrSystemInfoList);
+ assertEquals(esrVnfmDetail.getEsrSystemInfoList(), esrSystemInfoList);
+ }
+}
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java
new file mode 100644
index 0000000..f5d5228
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmListTest.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.aai.esr.entity.aai;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+
+public class EsrVnfmListTest {
+ @Test
+ public void getterAndSetter4EsrVnfmList() {
+ EsrVnfmList esrVnfmList = new EsrVnfmList();
+ ArrayList esrVnfms = new ArrayList();
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVnfmId("fadasf");
+ esrVnfms.add(esrVnfm);
+ esrVnfmList.setEsrVnfm(esrVnfms);
+ assertEquals(esrVnfmList.getEsrVnfm(), esrVnfms);
+ }
+}
diff --git a/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmTest.java b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmTest.java
new file mode 100644
index 0000000..efdf61d
--- /dev/null
+++ b/esr-mgr/src/test/java/org/onap/aai/esr/entity/aai/EsrVnfmTest.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onap.aai.esr.entity.aai;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class EsrVnfmTest {
+ @Test
+ public void getterAndSetter4vnfmId(){
+ final String vnfmId = "vnfmId-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVnfmId(vnfmId);
+ assertEquals(esrVnfm.getVnfmId(), vnfmId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion(){
+ final String resourceVersion = "resourceVersion-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setResourceVersion(resourceVersion);
+ assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4vimId(){
+ final String vimId = "vimId-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVimId(vimId);
+ assertEquals(esrVnfm.getVimId(), vimId);
+ }
+
+ @Test
+ public void getterAndSetter4certificateUrl(){
+ final String certificateUrl = "certificateUrl-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setCertificateUrl(certificateUrl);
+ assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
+ }
+}
--
cgit 1.2.3-korg