From: lizi00164331 Date: Wed, 20 Sep 2017 08:48:46 +0000 (+0800) Subject: Add unit test for VNFM bean class. X-Git-Tag: v1.0.0~46 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fesr-server.git;a=commitdiff_plain;h=c401a51179f66ad22b462320d2b680fc6e564fdd Add unit test for VNFM bean class. Change-Id: Icdb9009bc343d1b931126df927684e8d8cb4cc3b Issue-ID: AAI-351 Signed-off-by: lizi00164331 --- 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); + } +}