aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/onap/pomba/common/datatypes/VfTests.java')
-rw-r--r--src/test/java/org/onap/pomba/common/datatypes/VfTests.java112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
new file mode 100644
index 0000000..8b2a255
--- /dev/null
+++ b/src/test/java/org/onap/pomba/common/datatypes/VfTests.java
@@ -0,0 +1,112 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * 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.
+ * ============LICENSE_END=====================================================
+ */
+package org.onap.pomba.common.datatypes;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+public class VfTests {
+ @Test
+ public void testVF() {
+ VF aVF = new VF();
+ aVF.setName("VF name");
+ aVF.setType("Type");
+ aVF.setInvariantUuid("Invariant Uuid");
+ aVF.setUuid("Uuid");
+ aVF.setNfNamingCode("NF Naming Code");
+ assertTrue("VF name doesn't match", aVF.getName().equals("VF name"));
+ assertTrue("VF Type doesn't match", aVF.getType().equals("Type"));
+ assertTrue("VF Invariant Uuid doesn't match", aVF.getInvariantUuid().equals("Invariant Uuid"));
+ assertTrue("VF Uuid doesn't match", aVF.getUuid().equals("Uuid"));
+ assertTrue("VF NF Naming Code doesn't match", aVF.getNfNamingCode().equals("NF Naming Code"));
+ }
+
+ @Test
+ public void testSetVFModuleList() {
+ VF aVF = new VF();
+ List<VFModule> vfModuleList = new ArrayList<VFModule>();
+ assertEquals(vfModuleList.size(), 0);
+ VFModule vfModule = new VFModule();
+ vfModule.setInvariantUuid("Invariant Uuid");
+ vfModule.setMaxInstances(10);
+ vfModule.setMinInstances(1);
+ vfModule.setUuid("Uuid");
+ vfModuleList.add(vfModule);
+ aVF.setVfModules(vfModuleList);
+ assertEquals(vfModuleList.size(), 1);
+ }
+
+ @Test
+ public void testAddVfModule() {
+ VF aVF = new VF();
+ List<VFModule> vfModuleList = new ArrayList<VFModule>();
+ assertEquals(vfModuleList.size(), 0);
+ VFModule vfModule = new VFModule();
+ vfModule.setInvariantUuid("Invariant Uuid");
+ vfModule.setMaxInstances(10);
+ vfModule.setMinInstances(1);
+ vfModule.setUuid("Uuid");
+ vfModuleList.add(vfModule);
+ aVF.addVfModule(vfModule);
+ assertEquals(vfModuleList.size(), 1);
+ }
+
+ @Test
+ public void testGetVfModules() {
+ VF aVF = new VF();
+ List<VFModule> vfModuleList = new ArrayList<VFModule>();
+ assertEquals(vfModuleList.size(), 0);
+ VFModule vfModule = new VFModule();
+ vfModule.setInvariantUuid("Invariant Uuid");
+ vfModule.setMaxInstances(10);
+ vfModule.setMinInstances(1);
+ vfModule.setUuid("Uuid");
+ vfModuleList.add(vfModule);
+ aVF.addVfModule(vfModule);
+ List<VFModule> resultVFModules = aVF.getVfModules();
+ assertTrue("VF Modules doesn't match",
+ ((VFModule) resultVFModules.get(0)).getInvariantUuid().equals("Invariant Uuid"));
+ }
+
+ @Test
+ public void testSetVnfc() {
+ VF aVF = new VF();
+ List<VNFC> vnfcList = new ArrayList<VNFC>();
+ assertEquals(vnfcList.size(), 0);
+ VNFC aVNFC = new VNFC();
+ aVNFC.setName("VNFC name");
+ vnfcList.add(aVNFC);
+ aVF.setVnfc(vnfcList);
+ assertTrue("VNFC list item doesn't match", aVF.getVnfc().get(0).getName().equals("VNFC name"));
+ }
+
+ @Test
+ public void testAddVnfc() {
+ VF aVF = new VF();
+ assertEquals(aVF.getVnfc().size(), 0);
+ VNFC aVNFC = new VNFC();
+ aVNFC.setName("VNFC name");
+ aVF.addVnfc(aVNFC);
+ assertTrue("VNFC list item doesn't match", aVF.getVnfc().get(0).getName().equals("VNFC name"));
+ }
+}