diff options
Diffstat (limited to 'adapters/mso-vfc-adapter/src/test')
37 files changed, 4097 insertions, 20 deletions
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java new file mode 100644 index 0000000000..1fedac9cc9 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddPnfDataTest.java @@ -0,0 +1,189 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class AddPnfDataTest { + AddPnfData pnfData = new AddPnfData(); + + @Test + public void getPnfId() { + pnfData.getPnfId(); + } + + + @Test + public void setPnfId() { + pnfData.setPnfId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getPnfName() { + pnfData.getPnfName(); + } + + @Test + public void setPnfName() { + pnfData.setPnfName("Router"); + } + + @Test + public void getPnfdId() { + pnfData.getPnfdId(); + } + + @Test + public void setPnfdId() { + pnfData.setPnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getPnfProfileId() { + pnfData.getPnfProfileId(); + } + + @Test + public void setPnfProfileId() { + pnfData.setPnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getCpData() { + pnfData.getCpData(); + } + + @Test + public void setCpData() { + pnfData.setCpData(new List<PnfExtCpData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<PnfExtCpData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(PnfExtCpData pnfExtCpData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends PnfExtCpData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends PnfExtCpData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public PnfExtCpData get(int index) { + return null; + } + + @Override + public PnfExtCpData set(int index, PnfExtCpData element) { + return null; + } + + @Override + public void add(int index, PnfExtCpData element) { + + } + + @Override + public PnfExtCpData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<PnfExtCpData> listIterator() { + return null; + } + + @Override + public ListIterator<PnfExtCpData> listIterator(int index) { + return null; + } + + @Override + public List<PnfExtCpData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java new file mode 100644 index 0000000000..9444efd4c5 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AddressRangeTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AddressRangeTest { + AddressRange addressRange = new AddressRange(); + + @Test + public void getMinAddress() { + addressRange.getMinAddress(); + } + + @Test + public void setMinAddress() { + addressRange.setMinAddress("192.168.10.10"); + } + + @Test + public void getMaxAddress() { + addressRange.getMaxAddress(); + } + + @Test + public void setMaxAddress() { + addressRange.setMaxAddress("192.168.10.10"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java new file mode 100644 index 0000000000..06c52e2e52 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedNsTest.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedNsTest { + + AffectedNs affectedNs = new AffectedNs(); + + @Test + public void getNsInstanceId() { + affectedNs.getNsInstanceId(); + } + + @Test + public void setNsInstanceId() { + affectedNs.setNsInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getNsdId() { + affectedNs.getNsdId(); + } + + @Test + public void setNsdId() { + affectedNs.setNsdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java new file mode 100644 index 0000000000..beecbe0675 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedPnfTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedPnfTest { + AffectedPnf affectedPnf = new AffectedPnf(); + + @Test + public void getPnfid() { + affectedPnf.getPnfid(); + } + + @Test + public void setPnfid() { + affectedPnf.setPnfid("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getPnfdid() { + affectedPnf.getPnfdid(); + } + + @Test + public void setPnfdid() { + affectedPnf.setPnfdid("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getPnfProfileId() { + affectedPnf.getPnfProfileId(); + } + + @Test + public void setPnfProfileId() { + affectedPnf.setPnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getPnfName() { + affectedPnf.getPnfName(); + } + + @Test + public void setPnfName() { + affectedPnf.setPnfName("Router"); + } + + @Test + public void getCpInstanceId() { + affectedPnf.getCpInstanceId(); + } + + @Test + public void setCpInstanceId() { + affectedPnf.setCpInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java new file mode 100644 index 0000000000..b96fe32836 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedSapTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedSapTest { + AffectedSap affectedSap = new AffectedSap(); + + @Test + public void getSapInstanceId() { + affectedSap.getSapInstanceId(); + } + + @Test + public void setSapInstanceId() { + affectedSap.setSapInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getSapdId() { + affectedSap.getSapdId(); + } + + @Test + public void setSapdId() { + affectedSap.setSapdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getSapName() { + affectedSap.getSapName(); + } + + @Test + public void setSapName() { + affectedSap.setSapName("Dummy SAP"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java new file mode 100644 index 0000000000..dbc6d0811f --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVirtualLinkTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedVirtualLinkTest { + AffectedVirtualLink affectedVirtualLink = new AffectedVirtualLink(); + + @Test + public void getNsVirtualLinkInstanceId() { + affectedVirtualLink.getNsVirtualLinkInstanceId(); + } + + @Test + public void setNsVirtualLinkInstanceId() { + affectedVirtualLink.setNsVirtualLinkInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getNsVirtualLinkDescId() { + affectedVirtualLink.getNsVirtualLinkDescId(); + } + + @Test + public void setNsVirtualLinkDescId() { + affectedVirtualLink.setNsVirtualLinkDescId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVlProfileId() { + affectedVirtualLink.getVlProfileId(); + } + + @Test + public void setVlProfileId() { + affectedVirtualLink.setVlProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java new file mode 100644 index 0000000000..810f32d005 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnfTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedVnfTest { + AffectedVnf affectedVnf = new AffectedVnf(); + + @Test + public void getVnfInstanceId() { + affectedVnf.getVnfInstanceId(); + } + + @Test + public void setVnfInstanceId() { + affectedVnf.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfdId() { + affectedVnf.getVnfdId(); + } + + @Test + public void setVnfdId() { + affectedVnf.setVnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfProfileId() { + affectedVnf.getVnfProfileId(); + } + + @Test + public void setVnfProfileId() { + affectedVnf.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfName() { + affectedVnf.getVnfName(); + } + + @Test + public void setVnfName() { + affectedVnf.setVnfName("Dummy Vnf Name"); + } + + @Test + public void getChangedInfo() { + affectedVnf.getChangedInfo(); + } + + @Test + public void setChangedInfo() { + affectedVnf.setChangedInfo(new ChangedInfo()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java new file mode 100644 index 0000000000..0d5670133d --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffectedVnffgTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class AffectedVnffgTest { + AffectedVnffg affectedVnffg = new AffectedVnffg(); + + @Test + public void getVnffgInstanceId() { + affectedVnffg.getVnffgInstanceId(); + } + + @Test + public void setVnffgInstanceId() { + affectedVnffg.setVnffgInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnffgdId() { + affectedVnffg.getVnffgdId(); + } + + @Test + public void setVnffgdId() { + affectedVnffg.setVnffgdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java new file mode 100644 index 0000000000..99a40e4ee1 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/AffinityOrAntiAffinityRuleTest.java @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class AffinityOrAntiAffinityRuleTest { + AffinityOrAntiAffinityRule affinityOrAntiAffinityRule = new AffinityOrAntiAffinityRule(); + + @Test + public void getVnfdId() { + affinityOrAntiAffinityRule.getVnfdId(); + } + + @Test + public void setVnfdId() { + affinityOrAntiAffinityRule.setVnfdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfProfileId() { + affinityOrAntiAffinityRule.getVnfProfileId(); + } + + @Test + public void setVnfProfileId() { + affinityOrAntiAffinityRule.setVnfProfileId(new List<String>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<String> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(String s) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends String> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends String> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public String get(int index) { + return null; + } + + @Override + public String set(int index, String element) { + return null; + } + + @Override + public void add(int index, String element) { + + } + + @Override + public String remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<String> listIterator() { + return null; + } + + @Override + public ListIterator<String> listIterator(int index) { + return null; + } + + @Override + public List<String> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getVnfInstanceId() { + affinityOrAntiAffinityRule.getVnfInstanceId(); + } + + @Test + public void setVnfInstanceId() { + affinityOrAntiAffinityRule.setVnfInstanceId(new List<String>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<String> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(String s) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends String> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends String> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public String get(int index) { + return null; + } + + @Override + public String set(int index, String element) { + return null; + } + + @Override + public void add(int index, String element) { + + } + + @Override + public String remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<String> listIterator() { + return null; + } + + @Override + public ListIterator<String> listIterator(int index) { + return null; + } + + @Override + public List<String> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java new file mode 100644 index 0000000000..41077fbe67 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ChangedInfoTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ChangedInfoTest { + ChangedInfo changedInfo = new ChangedInfo(); + + @Test + public void getChangedVnfInfo() { + changedInfo.getChangedVnfInfo(); + } + + @Test + public void setChangedVnfInfo() { + changedInfo.setChangedVnfInfo(new ModifyVnfInfoData()); + } + + @Test + public void getChangedExtConnectivity() { + changedInfo.getChangedExtConnectivity(); + } + + @Test + public void setChangedExtConnectivity() { + changedInfo.setChangedExtConnectivity(new ExtVirtualLinkInfo()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java new file mode 100644 index 0000000000..e9c011b86a --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CivicAddressElementTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class CivicAddressElementTest { + CivicAddressElement civicAddressElement = new CivicAddressElement(); + + @Test + public void getCaType() { + civicAddressElement.getCaType(); + } + + @Test + public void setCaType() { + civicAddressElement.setCaType(12); + } + + @Test + public void getCaValue() { + civicAddressElement.getCaValue(); + } + + @Test + public void setCaValue() { + civicAddressElement.setCaValue("Dummy Ca value"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java new file mode 100644 index 0000000000..e47d02c926 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CpProtocolDataTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class CpProtocolDataTest { + CpProtocolData cpProtocolData = new CpProtocolData(); + + @Test + public void getLayerProtocol() { + cpProtocolData.getLayerProtocol(); + } + + @Test + public void setLayerProtocol() { + cpProtocolData.setLayerProtocol("BGP"); + } + + @Test + public void getIpOverEthernet() { + cpProtocolData.getIpOverEthernet(); + } + + @Test + public void setIpOverEthernet() { + cpProtocolData.setIpOverEthernet(new IpOverEthernetAddressData()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java new file mode 100644 index 0000000000..a2a6ae4fe1 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/CreateNsRequestTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class CreateNsRequestTest { + CreateNsRequest createNsRequest = new CreateNsRequest(); + + @Test + public void getNsdId() { + createNsRequest.getNsdId(); + } + + @Test + public void setNsdId() { + createNsRequest.setNsdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getNsDescription() { + createNsRequest.getNsDescription(); + } + + @Test + public void setNsDescription() { + createNsRequest.setNsDescription("Dummy description"); + } + + @Test + public void getNsName() { + createNsRequest.getNsName(); + } + + @Test + public void setNsName() { + createNsRequest.setNsName("Dummy Name"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java new file mode 100644 index 0000000000..92cec88b34 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtLinkPortInfoTest.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ExtLinkPortInfoTest { + + ExtLinkPortInfo extLinkPortInfo = new ExtLinkPortInfo(); + + @Test + public void getId() { + extLinkPortInfo.getId(); + } + + @Test + public void setId() { + extLinkPortInfo.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getResourceHandle() { + extLinkPortInfo.getResourceHandle(); + } + + @Test + public void setResourceHandle() { + extLinkPortInfo.setResourceHandle(new ResourceHandle()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java new file mode 100644 index 0000000000..c455b36a46 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ExtVirtualLinkInfoTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ExtVirtualLinkInfoTest { + ExtVirtualLinkInfo extVirtualLinkInfo = new ExtVirtualLinkInfo(); + + @Test + public void getId() { + extVirtualLinkInfo.getId(); + } + + @Test + public void setId() { + extVirtualLinkInfo.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getResourceHandle() { + extVirtualLinkInfo.getResourceHandle(); + } + + @Test + public void setResourceHandle() { + extVirtualLinkInfo.setResourceHandle(new ResourceHandle()); + } + + @Test + public void getExtLinkPorts() { + extVirtualLinkInfo.getExtLinkPorts(); + } + + @Test + public void setExtLinkPorts() { + extVirtualLinkInfo.setExtLinkPorts(new ExtLinkPortInfo()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java new file mode 100644 index 0000000000..f27b041690 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/InstantiateNsRequestTest.java @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class InstantiateNsRequestTest { + InstantiateNsRequest instantiateNsRequest = new InstantiateNsRequest(); + + @Test + public void getNsFlavourId() { + instantiateNsRequest.getNsFlavourId(); + } + + @Test + public void setNsFlavourId() { + instantiateNsRequest.setNsFlavourId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getSapData() { + instantiateNsRequest.getSapData(); + } + + @Test + public void setSapData() { + instantiateNsRequest.setSapData(new List<SapData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<SapData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(SapData sapData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends SapData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends SapData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public SapData get(int index) { + return null; + } + + @Override + public SapData set(int index, SapData element) { + return null; + } + + @Override + public void add(int index, SapData element) { + + } + + @Override + public SapData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<SapData> listIterator() { + return null; + } + + @Override + public ListIterator<SapData> listIterator(int index) { + return null; + } + + @Override + public List<SapData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAddpnfData() { + instantiateNsRequest.getAddpnfData(); + } + + @Test + public void setAddpnfData() { + instantiateNsRequest.setAddpnfData(new List<AddPnfData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AddPnfData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AddPnfData addPnfData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AddPnfData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AddPnfData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AddPnfData get(int index) { + return null; + } + + @Override + public AddPnfData set(int index, AddPnfData element) { + return null; + } + + @Override + public void add(int index, AddPnfData element) { + + } + + @Override + public AddPnfData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AddPnfData> listIterator() { + return null; + } + + @Override + public ListIterator<AddPnfData> listIterator(int index) { + return null; + } + + @Override + public List<AddPnfData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getVnfInstanceData() { + instantiateNsRequest.getVnfInstanceData(); + } + + @Test + public void setVnfInstanceData() { + instantiateNsRequest.setVnfInstanceData(new List<VnfInstanceData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<VnfInstanceData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(VnfInstanceData vnfInstanceData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends VnfInstanceData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends VnfInstanceData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public VnfInstanceData get(int index) { + return null; + } + + @Override + public VnfInstanceData set(int index, VnfInstanceData element) { + return null; + } + + @Override + public void add(int index, VnfInstanceData element) { + + } + + @Override + public VnfInstanceData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<VnfInstanceData> listIterator() { + return null; + } + + @Override + public ListIterator<VnfInstanceData> listIterator(int index) { + return null; + } + + @Override + public List<VnfInstanceData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getNestedNsInstanceId() { + instantiateNsRequest.getNestedNsInstanceId(); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java new file mode 100644 index 0000000000..edf6346bca --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpAddressesTest.java @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class IpAddressesTest { + IpAddresses ipAddresses = new IpAddresses(); + + @Test + public void getType() { + ipAddresses.getType(); + } + + @Test + public void setType() { + ipAddresses.setType("Dummy Type"); + } + + @Test + public void getFixedAddresses() { + ipAddresses.getFixedAddresses(); + } + + @Test + public void setFixedAddresses() { + ipAddresses.setFixedAddresses(new List<String>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<String> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(String s) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends String> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends String> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public String get(int index) { + return null; + } + + @Override + public String set(int index, String element) { + return null; + } + + @Override + public void add(int index, String element) { + + } + + @Override + public String remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<String> listIterator() { + return null; + } + + @Override + public ListIterator<String> listIterator(int index) { + return null; + } + + @Override + public List<String> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getNumDynamicAddresses() { + ipAddresses.getNumDynamicAddresses(); + } + + @Test + public void setNumDynamicAddresses() { + ipAddresses.setNumDynamicAddresses(5); + } + + @Test + public void getAddressRange() { + ipAddresses.getAddressRange(); + } + + @Test + public void setAddressRange() { + ipAddresses.setAddressRange(new AddressRange()); + } + + @Test + public void getSubnetId() { + ipAddresses.getSubnetId(); + } + + @Test + public void setSubnetId() { + ipAddresses.setSubnetId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java new file mode 100644 index 0000000000..0088cdc50b --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/IpOverEthernetAddressDataTest.java @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class IpOverEthernetAddressDataTest { + IpOverEthernetAddressData ipOverEthernetAddressData = new IpOverEthernetAddressData(); + + @Test + public void getMacAddress() { + ipOverEthernetAddressData.getMacAddress(); + } + + @Test + public void setMacAddress() { + ipOverEthernetAddressData.setMacAddress("4e:86:9f:62:c1:bf"); + } + + @Test + public void getIpAddresses() { + ipOverEthernetAddressData.getIpAddresses(); + } + + @Test + public void setIpAddresses() { + ipOverEthernetAddressData.setIpAddresses(new List<IpAddresses>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<IpAddresses> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(IpAddresses ipAddresses) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends IpAddresses> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends IpAddresses> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public IpAddresses get(int index) { + return null; + } + + @Override + public IpAddresses set(int index, IpAddresses element) { + return null; + } + + @Override + public void add(int index, IpAddresses element) { + + } + + @Override + public IpAddresses remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<IpAddresses> listIterator() { + return null; + } + + @Override + public ListIterator<IpAddresses> listIterator(int index) { + return null; + } + + @Override + public List<IpAddresses> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java new file mode 100644 index 0000000000..e447c85ee7 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinkTest.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class LinkTest { + Link link = new Link(); + + @Test + public void getHref() { + link.getHref(); + } + + @Test + public void setHref() { + link.setHref("dummy href"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java new file mode 100644 index 0000000000..aef87c47b1 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LinksTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class LinksTest { + Links links = new Links(); + + @Test + public void getSelf() { + links.getSelf(); + } + + @Test + public void setSelf() { + links.setSelf(new Link()); + } + + @Test + public void getNsInstance() { + links.getNsInstance(); + } + + @Test + public void setNsInstance() { + links.setNsInstance(new Link()); + } + + @Test + public void getCancel() { + links.getCancel(); + } + + @Test + public void setCancel() { + links.setCancel(new Link()); + } + + @Test + public void getRetry() { + links.getRetry(); + } + + @Test + public void setRetry() { + links.setRetry(new Link()); + } + + @Test + public void getRollback() { + links.getRollback(); + } + + @Test + public void setRollback() { + links.setRollback(new Link()); + } + + @Test + public void getContinues() { + links.getContinues(); + } + + @Test + public void setContinues() { + links.setContinues(new Link()); + } + + @Test + public void getFail() { + links.getFail(); + } + + @Test + public void setFail() { + links.setFail(new Link()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java new file mode 100644 index 0000000000..e68b12a626 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/LocationConstraintsTest.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class LocationConstraintsTest { + LocationConstraints locationConstraints = new LocationConstraints(); + + @Test + public void getCountryCode() { + locationConstraints.getCountryCode(); + } + + @Test + public void setCountryCode() { + locationConstraints.setCountryCode("IND"); + + } + + @Test + public void getCivicAddressElement() { + locationConstraints.getCivicAddressElement(); + } + + @Test + public void setCivicAddressElement() { + locationConstraints.setCivicAddressElement(new CivicAddressElement()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java new file mode 100644 index 0000000000..c300923857 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ModifyVnfInfoDataTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.HashMap; +import static org.junit.Assert.*; + +public class ModifyVnfInfoDataTest { + ModifyVnfInfoData modifyVnfInfoData = new ModifyVnfInfoData(); + + @Test + public void getVnfInstanceId() { + modifyVnfInfoData.getVnfInstanceId(); + } + + @Test + public void setVnfInstanceId() { + modifyVnfInfoData.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfInstanceName() { + modifyVnfInfoData.getVnfInstanceName(); + } + + @Test + public void setVnfInstanceName() { + modifyVnfInfoData.setVnfInstanceName("Dummy vnfInstanceName"); + } + + @Test + public void getVnfInstanceDescription() { + modifyVnfInfoData.getVnfInstanceDescription(); + } + + @Test + public void setVnfInstanceDescription() { + modifyVnfInfoData.setVnfInstanceDescription("Dummy vnfInstanceDescription"); + } + + @Test + public void getVnfPkgId() { + modifyVnfInfoData.getVnfPkgId(); + } + + @Test + public void setVnfPkgId() { + modifyVnfInfoData.setVnfPkgId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfConfigurableProperties() { + modifyVnfInfoData.getVnfConfigurableProperties(); + } + + @Test + public void setVnfConfigurableProperties() { + modifyVnfInfoData.setVnfConfigurableProperties(new HashMap<>()); + } + + @Test + public void getMetadata() { + modifyVnfInfoData.getMetadata(); + } + + @Test + public void setMetadata() { + modifyVnfInfoData.setMetadata(new HashMap<>()); + } + + @Test + public void getExtensions() { + modifyVnfInfoData.getExtensions(); + } + + @Test + public void setExtensions() { + modifyVnfInfoData.setExtensions(new HashMap<>()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java new file mode 100644 index 0000000000..f5d485a8c7 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/NsLcmOpOccTest.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import org.onap.so.adapters.vfc.constant.CommonConstant; +import java.time.LocalDateTime; +import java.util.Date; +import static org.junit.Assert.*; + +public class NsLcmOpOccTest { + NsLcmOpOcc nsLcmOpOcc = new NsLcmOpOcc(); + + @Test + public void getLcmOperationType() { + nsLcmOpOcc.getLcmOperationType(); + } + + @Test + public void setLcmOperationType() { + nsLcmOpOcc.setLcmOperationType(CommonConstant.lcmOperationType.INSTANTIATE); + } + + @Test + public void getCancelMode() { + nsLcmOpOcc.getCancelMode(); + } + + @Test + public void setCancelMode() { + nsLcmOpOcc.setCancelMode(CommonConstant.cancelMode.GRACEFUL); + } + + @Test + public void getOperationState() { + nsLcmOpOcc.getOperationState(); + } + + @Test + public void setOperationState() { + nsLcmOpOcc.setOperationState(CommonConstant.operationState.COMPLETED); + } + + @Test + public void getId() { + nsLcmOpOcc.getId(); + } + + @Test + public void setId() { + nsLcmOpOcc.setId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getStatusEnteredTime() { + nsLcmOpOcc.getStatusEnteredTime(); + } + + @Test + public void setStatusEnteredTime() { + nsLcmOpOcc.setStatusEnteredTime(LocalDateTime.now().toString()); + } + + @Test + public void getNsInstanceId() { + nsLcmOpOcc.getNsInstanceId(); + } + + @Test + public void setNsInstanceId() { + nsLcmOpOcc.setNsInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getStartTime() { + nsLcmOpOcc.getStartTime(); + } + + @Test + public void setStartTime() { + nsLcmOpOcc.setStartTime(LocalDateTime.now().toString()); + } + + @Test + public void getAutomaticInvocation() { + nsLcmOpOcc.getAutomaticInvocation(); + } + + @Test + public void setAutomaticInvocation() { + nsLcmOpOcc.setAutomaticInvocation(true); + } + + @Test + public void getOperationParams() { + nsLcmOpOcc.getOperationParams(); + } + + @Test + public void setOperationParams() { + nsLcmOpOcc.setOperationParams("Dummy operationParams"); + } + + @Test + public void getCancelPending() { + nsLcmOpOcc.getCancelPending(); + } + + @Test + public void setCancelPending() { + nsLcmOpOcc.setCancelPending(true); + } + + @Test + public void getError() { + nsLcmOpOcc.getError(); + } + + @Test + public void setError() { + nsLcmOpOcc.setError(new ProblemDetails()); + } + + @Test + public void getLinks() { + nsLcmOpOcc.getLinks(); + } + + @Test + public void setLinks() { + nsLcmOpOcc.setLinks(new Links()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java new file mode 100644 index 0000000000..e0455b0728 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ParamsForVnfTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.HashMap; +import static org.junit.Assert.*; + +public class ParamsForVnfTest { + + ParamsForVnf paramsForVnf = new ParamsForVnf(); + + @Test + public void getVnfProfileId() { + paramsForVnf.getVnfProfileId(); + } + + @Test + public void setVnfProfileId() { + paramsForVnf.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getAdditionalParams() { + paramsForVnf.getAdditionalParams(); + } + + @Test + public void setAdditionalParams() { + paramsForVnf.setAdditionalParams(new HashMap<>()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java new file mode 100644 index 0000000000..c586c7eb65 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/PnfExtCpDataTest.java @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class PnfExtCpDataTest { + PnfExtCpData pnfExtCpData = new PnfExtCpData(); + + @Test + public void getCpInstanceI16() { + pnfExtCpData.getCpInstanceI16(); + } + + @Test + public void setCpInstanceI16() { + pnfExtCpData.setCpInstanceI16("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getCpdId() { + pnfExtCpData.getCpdId(); + } + + @Test + public void setCpdId() { + pnfExtCpData.setCpdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getCpProtocolData() { + pnfExtCpData.getCpProtocolData(); + } + + @Test + public void setCpProtocolData() { + pnfExtCpData.setCpProtocolData(new List<CpProtocolData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<CpProtocolData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(CpProtocolData cpProtocolData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends CpProtocolData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends CpProtocolData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public CpProtocolData get(int index) { + return null; + } + + @Override + public CpProtocolData set(int index, CpProtocolData element) { + return null; + } + + @Override + public void add(int index, CpProtocolData element) { + + } + + @Override + public CpProtocolData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<CpProtocolData> listIterator() { + return null; + } + + @Override + public ListIterator<CpProtocolData> listIterator(int index) { + return null; + } + + @Override + public List<CpProtocolData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java new file mode 100644 index 0000000000..ddea6cca40 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ProblemDetailsTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ProblemDetailsTest { + ProblemDetails problemDetails = new ProblemDetails(); + + @Test + public void getType() { + problemDetails.getType(); + } + + @Test + public void setType() { + problemDetails.setType("Dummy Type"); + } + + @Test + public void getTitle() { + problemDetails.getTitle(); + } + + @Test + public void setTitle() { + problemDetails.setTitle("Dummy Title"); + } + + @Test + public void getStatus() { + problemDetails.getStatus(); + } + + @Test + public void setStatus() { + problemDetails.setStatus(200); + } + + @Test + public void getDetail() { + problemDetails.getDetail(); + } + + @Test + public void setDetail() { + problemDetails.setTitle("Dummy Title"); + } + + @Test + public void getInstance() { + problemDetails.getInstance(); + } + + @Test + public void setInstance() { + problemDetails.setInstance("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java new file mode 100644 index 0000000000..9c4a0295e6 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceChangesTest.java @@ -0,0 +1,773 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class ResourceChangesTest { + ResourceChanges resourceChanges = new ResourceChanges(); + + @Test + public void getAffectedVnfs() { + resourceChanges.getAffectedVnfs(); + } + + @Test + public void setAffectedVnfs() { + resourceChanges.setAffectedVnfs(new List<AffectedVnf>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedVnf> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedVnf affectedVnf) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedVnf> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedVnf> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedVnf get(int index) { + return null; + } + + @Override + public AffectedVnf set(int index, AffectedVnf element) { + return null; + } + + @Override + public void add(int index, AffectedVnf element) { + + } + + @Override + public AffectedVnf remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedVnf> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedVnf> listIterator(int index) { + return null; + } + + @Override + public List<AffectedVnf> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAffectedPnfs() { + resourceChanges.getAffectedPnfs(); + } + + @Test + public void setAffectedPnfs() { + resourceChanges.setAffectedPnfs(new List<AffectedPnf>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedPnf> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedPnf affectedPnf) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedPnf> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedPnf> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedPnf get(int index) { + return null; + } + + @Override + public AffectedPnf set(int index, AffectedPnf element) { + return null; + } + + @Override + public void add(int index, AffectedPnf element) { + + } + + @Override + public AffectedPnf remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedPnf> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedPnf> listIterator(int index) { + return null; + } + + @Override + public List<AffectedPnf> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAffectedVls() { + resourceChanges.getAffectedVls(); + } + + @Test + public void setAffectedVls() { + resourceChanges.setAffectedVls(new List<AffectedVirtualLink>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedVirtualLink> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedVirtualLink affectedVirtualLink) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedVirtualLink> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedVirtualLink> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedVirtualLink get(int index) { + return null; + } + + @Override + public AffectedVirtualLink set(int index, AffectedVirtualLink element) { + return null; + } + + @Override + public void add(int index, AffectedVirtualLink element) { + + } + + @Override + public AffectedVirtualLink remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedVirtualLink> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedVirtualLink> listIterator(int index) { + return null; + } + + @Override + public List<AffectedVirtualLink> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAffectedVnffgs() { + resourceChanges.getAffectedVnffgs(); + } + + @Test + public void setAffectedVnffgs() { + resourceChanges.setAffectedVnffgs(new List<AffectedVnffg>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedVnffg> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedVnffg affectedVnffg) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedVnffg> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedVnffg> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedVnffg get(int index) { + return null; + } + + @Override + public AffectedVnffg set(int index, AffectedVnffg element) { + return null; + } + + @Override + public void add(int index, AffectedVnffg element) { + + } + + @Override + public AffectedVnffg remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedVnffg> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedVnffg> listIterator(int index) { + return null; + } + + @Override + public List<AffectedVnffg> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAffectedNss() { + resourceChanges.getAffectedNss(); + } + + @Test + public void setAffectedNss() { + resourceChanges.setAffectedNss(new List<AffectedNs>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedNs> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedNs affectedNs) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedNs> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedNs> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedNs get(int index) { + return null; + } + + @Override + public AffectedNs set(int index, AffectedNs element) { + return null; + } + + @Override + public void add(int index, AffectedNs element) { + + } + + @Override + public AffectedNs remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedNs> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedNs> listIterator(int index) { + return null; + } + + @Override + public List<AffectedNs> subList(int fromIndex, int toIndex) { + return null; + } + }); + } + + @Test + public void getAffectedSaps() { + resourceChanges.getAffectedSaps(); + } + + @Test + public void setAffectedSaps() { + resourceChanges.setAffectedSaps(new List<AffectedSap>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<AffectedSap> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(AffectedSap affectedSap) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends AffectedSap> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends AffectedSap> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public AffectedSap get(int index) { + return null; + } + + @Override + public AffectedSap set(int index, AffectedSap element) { + return null; + } + + @Override + public void add(int index, AffectedSap element) { + + } + + @Override + public AffectedSap remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<AffectedSap> listIterator() { + return null; + } + + @Override + public ListIterator<AffectedSap> listIterator(int index) { + return null; + } + + @Override + public List<AffectedSap> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java new file mode 100644 index 0000000000..6390c5afbd --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/ResourceHandleTest.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ResourceHandleTest { + ResourceHandle resourceHandle = new ResourceHandle(); + + @Test + public void getVimId() { + resourceHandle.getVimId(); + } + + @Test + public void setVimId() { + resourceHandle.setVimId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getResourceProviderId() { + resourceHandle.getResourceProviderId(); + } + + @Test + public void setResourceProviderId() { + resourceHandle.setResourceProviderId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getResourceId() { + resourceHandle.getResourceId(); + } + + @Test + public void setResourceId() { + resourceHandle.setResourceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVimLevelResourceType() { + resourceHandle.getVimLevelResourceType(); + } + + @Test + public void setVimLevelResourceType() { + resourceHandle.setVimLevelResourceType("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java new file mode 100644 index 0000000000..2a455994b8 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/SapDataTest.java @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import static org.junit.Assert.*; + +public class SapDataTest { + + SapData sapData = new SapData(); + + @Test + public void getSapdId() { + sapData.getSapdId(); + } + + @Test + public void setSapdId() { + sapData.setSapdId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getSapName() { + sapData.getSapName(); + } + + @Test + public void setSapName() { + sapData.setSapName("Dummy SapName"); + } + + @Test + public void getDescription() { + sapData.getDescription(); + } + + @Test + public void setDescription() { + sapData.setDescription("Dummy Description"); + } + + @Test + public void getSapProtocolData() { + sapData.getSapProtocolData(); + } + + @Test + public void setSapProtocolData() { + sapData.setSapProtocolData(new List<CpProtocolData>() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator<CpProtocolData> iterator() { + return null; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public <T> T[] toArray(T[] a) { + return null; + } + + @Override + public boolean add(CpProtocolData cpProtocolData) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean containsAll(Collection<?> c) { + return false; + } + + @Override + public boolean addAll(Collection<? extends CpProtocolData> c) { + return false; + } + + @Override + public boolean addAll(int index, Collection<? extends CpProtocolData> c) { + return false; + } + + @Override + public boolean removeAll(Collection<?> c) { + return false; + } + + @Override + public boolean retainAll(Collection<?> c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public CpProtocolData get(int index) { + return null; + } + + @Override + public CpProtocolData set(int index, CpProtocolData element) { + return null; + } + + @Override + public void add(int index, CpProtocolData element) { + + } + + @Override + public CpProtocolData remove(int index) { + return null; + } + + @Override + public int indexOf(Object o) { + return 0; + } + + @Override + public int lastIndexOf(Object o) { + return 0; + } + + @Override + public ListIterator<CpProtocolData> listIterator() { + return null; + } + + @Override + public ListIterator<CpProtocolData> listIterator(int index) { + return null; + } + + @Override + public List<CpProtocolData> subList(int fromIndex, int toIndex) { + return null; + } + }); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java new file mode 100644 index 0000000000..b9bdfe3f6e --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfInstanceDataTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class VnfInstanceDataTest { + VnfInstanceData vnfInstanceData = new VnfInstanceData(); + + @Test + public void getVnfInstanceId() { + vnfInstanceData.getVnfInstanceId(); + } + + @Test + public void setVnfInstanceId() { + vnfInstanceData.setVnfInstanceId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getVnfProfileId() { + vnfInstanceData.getVnfProfileId(); + } + + @Test + public void setVnfProfileId() { + vnfInstanceData.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java new file mode 100644 index 0000000000..b8f9b8e3e2 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/model/VnfLocationConstraintTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.model; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class VnfLocationConstraintTest { + VnfLocationConstraint vnfLocationConstraint = new VnfLocationConstraint(); + + @Test + public void getVnfProfileId() { + vnfLocationConstraint.getVnfProfileId(); + } + + @Test + public void setVnfProfileId() { + vnfLocationConstraint.setVnfProfileId("c9f0a95e-dea0-4698-96e5-5a79bc5a233d"); + } + + @Test + public void getLocationConstraints() { + vnfLocationConstraint.getLocationConstraints(); + } + + @Test + public void setLocationConstraints() { + vnfLocationConstraint.setLocationConstraints(new LocationConstraint()); + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java new file mode 100644 index 0000000000..799283ddb4 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/VfcManagerSol005Test.java @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2019 Verizon. All Rights Reserved 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.so.adapters.vfc.rest; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.onap.so.adapters.vfc.exceptions.ApplicationException; +import org.onap.so.adapters.vfc.model.NSResourceInputParameter; +import org.onap.so.adapters.vfc.model.RestfulResponse; +import org.onap.so.adapters.vfc.util.JsonUtil; +import org.onap.so.adapters.vfc.util.RestfulUtil; +import org.onap.so.db.request.beans.InstanceNfvoMapping; +import org.onap.so.db.request.beans.OperationStatus; +import org.onap.so.db.request.beans.ResourceOperationStatus; +import org.onap.so.db.request.data.repository.InstanceNfvoMappingRepository; +import org.onap.so.db.request.data.repository.OperationStatusRepository; +import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository; +import org.springframework.test.context.junit4.SpringRunner; +import java.io.File; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import static org.mockito.Mockito.when; + +@RunWith(SpringRunner.class) +public class VfcManagerSol005Test { + @InjectMocks + VfcManagerSol005 vfcManagerSol005; + + @Mock + InstanceNfvoMappingRepository instanceNfvoMappingRepository; + + @Mock + ResourceOperationStatusRepository resourceOperationStatusRepository; + + @Mock + OperationStatusRepository operationStatusRepository; + + @Mock + RestfulUtil restfulUtil; + + OperationStatus operationStatus = new OperationStatus(); + + InstanceNfvoMapping instanceNfvoMapping = new InstanceNfvoMapping(); + RestfulResponse restfulResponse = new RestfulResponse(); + RestfulResponse vfcrestfulResponse = new RestfulResponse(); + NSResourceInputParameter nsResourceInputParameter = new NSResourceInputParameter(); + ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus(); + + @Test + public void createNs() throws ApplicationException, Exception { + restfulResponse.setStatus(200); + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + + File file = new File(classLoader.getResource("json/createNsReq.json").getFile()); + String content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class); + file = new File(classLoader.getResource("json/aainfvoResponse.json").getFile()); + content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + restfulResponse.setResponseContent(content); + // restfulResponse.setResponseContent("{\"nfvoId\":\"6ee79fe2-9579-475a-9bb9-20cf4358a19e\",\"name\":\"external_nfvo\",\"api-root\":\"xyz\",\"vendor\":\"vz\",\"version\":\"v1.0\",\"url\":\"http://sample.com/\",\"userName\":\"admin\",\"password\":\"sacjnasnc\"}"); + file = new File(classLoader.getResource("json/createNsSol005Response.json").getFile()); + content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + vfcrestfulResponse.setStatus(202); + vfcrestfulResponse.setResponseContent(content); + // vfcrestfulResponse.setResponseContent("{\"_links\": {\"heal\": {\"href\": \"\"}, \"instantiate\": {\"href\": + // \"\"}, \"nestedNsInstances\": {\"href\": \"\"}, \"scale\": {\"href\": \"\"}, \"self\": {\"href\": \"\"}, + // \"terminate\": {\"href\": \"\"}, \"update\": {\"href\": \"\"}}, \"additionalAffinityOrAntiAffiniityRule\": + // [{\"Scope\": \"\", \"affinityOrAntiAffiinty\": \"\", \"vnfInstanceId\": [], \"vnfProfileId\": [], \"vnfdId\": + // []}], \"flavourId\": \"\", \"id\": \"c9f0a95e-dea0-4698-96e5-5a79bc5a233d\", \"nestedNsInstanceId\": [], + // \"nsInstanceDescription\": \"\", \"nsInstanceName\": \"\", \"nsScaleStatus\": [{\"nsScaleLevelId\": \"\", + // \"nsScalingAspectId\": \"\"}], \"nsState\": \"\", \"nsdId\": \"\", \"nsdInfoId\": \"\", \"pnfInfo\": + // [{\"cpInfo\": [{\"cpInstanceId\": \"\", \"cpProtocolData\": {\"ipOverEthernet\": {\"ipAddresses\": + // {\"addressRange\": {\"maxAddress\": \"\", \"minAddress\": \"\"}, \"fixedAddresses\": \"\", + // \"numDynamicAddresses\": 1, \"subnetId\": \"\", \"type\": \"\"}, \"macAddress\": {}}, \"layerProtocol\": + // \"IP_OVER_ETHERNET\"}, \"cpdId\": \"\"}], \"pnfId\": \"\", \"pnfName\": \"\", \"pnfProfileId\": \"\", + // \"pnfdId\": \"\", \"pnfdInfoId\": \"\"}], \"sapInfo\": [{\"description\": \"\", \"id\": \"\", \"sapName\": + // \"\", \"sapProtocolInfo\": {\"ipOverEthernet\": {\"ipAddresses\": {\"addressRange\": {\"maxAddress\": \"\", + // \"minAddress\": \"\"}, \"fixedAddresses\": \"\", \"numDynamicAddresses\": 1, \"subnetId\": \"\", \"type\": + // \"\"}, \"macAddress\": \"\"}, \"layerProtocol\": \"IP_OVER_ETHERNET\"}, \"sapdId\": \"\"}], + // \"virtualLinkInfo\": [{\"id\": \"\", \"linkPort\": [{\"id\": \"\", \"resourceHandle\": {\"resourceId\": \"\", + // \"resourceProviderId\": \"\", \"vimId\": \"\", \"vimLevelResourceType\": \"\"}}], \"nsVirtualLinkDescId\": + // \"\", \"resourceHandle\": [{\"resourceId\": \"\", \"resourceProviderId\": \"\", \"vimId\": \"\", + // \"vimLevelResourceType\": \"\"}]}], \"vnfInstance\": [{\"vnfInstanceId\": \"\", \"vnfProfileId\": \"\"}], + // \"vnffgInfo\": [{\"id\": \"\", \"nfpInfo\": [{\"description\": \"\", \"id\": \"\", \"nfpName\": \"\", + // \"nfpRule\": {\"destinationIpAddressPrefix\": \"\", \"destinationPortRange\": \"\", \"dscp\": \"\", + // \"etherDestinationAddress\": \"\", \"etherSourceAddress\": \"\", \"etherType\": \"\", \"extendedCriteria\": + // [{\"length\": 1, \"startingPoint\": 1, \"value\": \"\"}], \"protocol\": \"\", \"sourceIpAddressPrefix\": + // \"\", \"sourcePortRange\": \"\", \"vlanTag\": []}, \"nfpState\": \"\", \"nfpdId\": \"\", \"nscpHandle\": + // [{\"nsInstanceId\": \"\", \"nsSapInstanceId\": \"\", \"pnfExtCpInstanceId\": \"\", \"pnfInfoId\": \"\", + // \"vnfExtCpInstanceId\": \"\", \"vnfInstanceId\": \"\"}], \"totalCp\": 1}], \"nsCpHandle\": + // [{\"nsInstanceId\": \"\", \"nsSapInstanceId\": \"\", \"pnfExtCpInstanceId\": \"\", \"pnfInfoId\": \"\", + // \"vnfExtCpInstanceId\": \"\", \"vnfInstanceId\": \"\"}], \"nsVirtualLinkInfoId\": [], \"pnfInfoId\": [], + // \"vnfInstanceId\": [], \"vnffgdId\": \"\"}]}"); + + resourceOperationStatus.setStatus("processing"); + resourceOperationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId()); + resourceOperationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId()); + resourceOperationStatus + .setResourceTemplateUUID(nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID()); + when(instanceNfvoMappingRepository.save(instanceNfvoMapping)).thenReturn(instanceNfvoMapping); + when(restfulUtil.getNfvoFromAAI("b1bb0ce7-2222-4fa7-95ed-4840d70a1101")).thenReturn(restfulResponse); + when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyMap())) + .thenReturn(vfcrestfulResponse); + when(resourceOperationStatusRepository.save(resourceOperationStatus)).thenReturn(resourceOperationStatus); + vfcManagerSol005.createNs(nsResourceInputParameter); + + } + + @Test + public void terminateNs() throws Exception { + instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101"); + instanceNfvoMapping.setPassword("sacjnasnc"); + instanceNfvoMapping.setUsername("admin"); + instanceNfvoMapping.setNfvoName("external_nfvo"); + instanceNfvoMapping.setEndpoint("http://sample.com/"); + instanceNfvoMapping.setApiRoot("xyz"); + String nsInstanceId = "c9f0a95e-dea0-4698-96e5-5a79bc5a233d"; + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + File file = new File(classLoader.getResource("json/createNsReq.json").getFile()); + String content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class); + Map<String, String> header = new HashMap<>(); + header.put("Location", "http://192.168.10.57:5000/ns_lcm_op_ops/12204a12-7da2-4ddf-8c2f-992a1a1acebf"); + vfcrestfulResponse.setStatus(202); + vfcrestfulResponse.setResponseContent(null); + vfcrestfulResponse.setRespHeaderMap(header); + when(instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId)).thenReturn(instanceNfvoMapping); + when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())) + .thenReturn(vfcrestfulResponse); + vfcManagerSol005.terminateNs(nsResourceInputParameter.getNsOperationKey(), nsInstanceId); + } + + @Test + public void getNsProgress() throws Exception { + String jobId = "12204a12-7da2-4ddf-8c2f-992a1a1acebf"; + instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101"); + instanceNfvoMapping.setPassword("sacjnasnc"); + instanceNfvoMapping.setUsername("admin"); + instanceNfvoMapping.setNfvoName("external_nfvo"); + instanceNfvoMapping.setEndpoint("http://sample.com/"); + instanceNfvoMapping.setApiRoot("xyz"); + instanceNfvoMapping.setJobId(jobId); + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + File file = new File(classLoader.getResource("json/createNsReq.json").getFile()); + String content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class); + operationStatus.setProgress("40"); + operationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId()); + operationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId()); + ResourceOperationStatus resourceOperationStatus = + new ResourceOperationStatus(nsResourceInputParameter.getNsOperationKey().getServiceId(), + nsResourceInputParameter.getNsOperationKey().getOperationId(), + nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID()); + file = new File(classLoader.getResource("json/lcmOperRsp.json").getFile()); + content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + vfcrestfulResponse.setStatus(202); + vfcrestfulResponse.setResponseContent(content); + List<ResourceOperationStatus> resourceOperationStatuses = new ArrayList<>(); + resourceOperationStatuses.add(resourceOperationStatus); + when(instanceNfvoMappingRepository.findOneByJobId(jobId)).thenReturn(instanceNfvoMapping); + when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())) + .thenReturn(vfcrestfulResponse); + when(operationStatusRepository.findOneByServiceIdAndOperationId( + nsResourceInputParameter.getNsOperationKey().getServiceId(), + nsResourceInputParameter.getNsOperationKey().getOperationId())).thenReturn(operationStatus); + when(resourceOperationStatusRepository.findByServiceIdAndOperationId( + nsResourceInputParameter.getNsOperationKey().getServiceId(), + nsResourceInputParameter.getNsOperationKey().getOperationId())).thenReturn(resourceOperationStatuses); + when(operationStatusRepository.save(operationStatus)).thenReturn(operationStatus); + vfcManagerSol005.getNsProgress(nsResourceInputParameter.getNsOperationKey(), jobId); + + } + + @Test + public void instantiateNs() throws Exception { + String nsInstanceId = "c9f0a95e-dea0-4698-96e5-5a79bc5a233d"; + ClassLoader classLoader = ClassLoader.getSystemClassLoader(); + File file = new File(classLoader.getResource("json/createNsReq.json").getFile()); + String content = new String(Files.readAllBytes(file.toPath())).replace("\n", ""); + nsResourceInputParameter = JsonUtil.unMarshal(content, NSResourceInputParameter.class); + instanceNfvoMapping.setInstanceId("b1bb0ce7-2222-4fa7-95ed-4840d70a1101"); + instanceNfvoMapping.setPassword("sacjnasnc"); + instanceNfvoMapping.setUsername("admin"); + instanceNfvoMapping.setNfvoName("external_nfvo"); + instanceNfvoMapping.setEndpoint("http://sample.com/"); + instanceNfvoMapping.setApiRoot("xyz"); + resourceOperationStatus.setStatus("processing"); + resourceOperationStatus.setOperationId(nsResourceInputParameter.getNsOperationKey().getOperationId()); + resourceOperationStatus.setServiceId(nsResourceInputParameter.getNsOperationKey().getServiceId()); + resourceOperationStatus + .setResourceTemplateUUID(nsResourceInputParameter.getNsOperationKey().getNodeTemplateUUID()); + Map<String, String> header = new HashMap<>(); + header.put("Location", "http://192.168.10.57:5000/ns_lcm_op_ops/12204a12-7da2-4ddf-8c2f-992a1a1acebf"); + vfcrestfulResponse.setStatus(202); + vfcrestfulResponse.setResponseContent(null); + vfcrestfulResponse.setRespHeaderMap(header); + when(instanceNfvoMappingRepository.findOneByInstanceId(nsInstanceId)).thenReturn(instanceNfvoMapping); + when(restfulUtil.send(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())) + .thenReturn(vfcrestfulResponse); + when(resourceOperationStatusRepository.save(resourceOperationStatus)).thenReturn(resourceOperationStatus); + when(instanceNfvoMappingRepository.save(instanceNfvoMapping)).thenReturn(instanceNfvoMapping); + vfcManagerSol005.instantiateNs(nsInstanceId, nsResourceInputParameter); + + } +} diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java index c388016ab4..4b6baa5cf4 100644 --- a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java +++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/util/RestfulUtilTest.java @@ -22,6 +22,8 @@ package org.onap.so.adapters.vfc.util; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; +import org.apache.http.Header; +import org.apache.http.message.BasicHeader; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpDelete; @@ -59,21 +61,27 @@ public class RestfulUtilTest { private HttpEntity httpEntity; private HttpResponse httpResponse; private StatusLine statusLine; + private Header httpResponseHeader; @Before public void setUp() { httpEntity = mock(HttpEntity.class); httpResponse = mock(HttpResponse.class); statusLine = mock(StatusLine.class); + httpResponseHeader = mock(Header.class); } private void sendInit() throws IOException { + Header[] headerList = new BasicHeader[2]; + headerList[0] = new BasicHeader("Content-Type", "application/json"); + headerList[1] = new BasicHeader("cache-control", "no-cache"); doReturn("https://testHost/").when(restfulUtil).getMsbHost(); when(statusLine.getStatusCode()).thenReturn(HttpStatus.OK.value()); when(httpResponse.getStatusLine()).thenReturn(statusLine); when(httpResponse.getEntity()).thenReturn(httpEntity); + when(httpResponse.getAllHeaders()).thenReturn(headerList); } @Test diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json b/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json new file mode 100644 index 0000000000..35047a9c21 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/resources/json/aainfvoResponse.json @@ -0,0 +1,10 @@ +{ + "nfvoId":"6ee79fe2-9579-475a-9bb9-20cf4358a19e", + "name":"external_nfvo", + "api-root":"xyz", + "vendor":"vz", + "version":"v1.0", + "url":"http://sample.com/", + "userName":"admin", + "password":"sacjnasnc" +}
\ No newline at end of file diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json b/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json index 047c81081e..aec8ae809d 100644 --- a/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json +++ b/adapters/mso-vfc-adapter/src/test/resources/json/createNsReq.json @@ -1,32 +1,56 @@ { - "nsServiceName":"vIMS", - "nsServiceDescription":"vIMS NS", + "nsServiceName":"vcpe_e2e_vnf_test2", + "nsServiceDescription":"null", + "nsServiceModelUUID":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d", "nsOperationKey":{ - "globalSubscriberId":"9b9f02c0-298b-458a-bc9c-be3692e4f350", - "serviceType":"service", - "serviceId":"9b9f02c0-298b-458a-bc9c-be3692e4f351", - "operationId":"9b9f02c0-298b-458a-bc9c-be3692e4f352", - "nodeTemplateUUID":"9b9f02c0-298b-458a-bc9c-be3692e4f353" + "globalSubscriberId":"Demonstration", + "serviceType":"vCPE", + "serviceId":"996fadbb-e806-4a19-b0e5-3454ad6ac29e", + "operationId":"1f1dd6b2-b027-4008-a9df-3b6c8274fb24", + "nodeTemplateUUID":"4d3a835c-29c8-4a63-83a4-50de5f7ffe16" }, "nsParameters":{ "locationConstraints":[ { - "vnfProfileId":"zte-CSCF-1.0", "locationConstraints":{ - "vimId":"1" - } + "vimId":"CloudOwner_regionOne" + }, + "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1101" + }, + { + "locationConstraints":{ + "vimId":"CloudOwner_regionOne" + }, + "vnfProfileId":"0408f076-e6c0-4c82-9940-272fddbb82de" + }, + { + "locationConstraints":{ + "vimId":"CloudOwner_regionOne" + }, + "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1100" + }, + { + "locationConstraints":{ + "vimId":"CloudOwner_regionOne" + }, + "vnfProfileId":"b1bb0ce7-2222-4fa7-95ed-4840d70a1102" + }, + { + "locationConstraints":{ + "vimId":"CloudOwner_regionOne" + }, + "vnfProfileId":"3fca3543-07f5-492f-812c-ed462e4f94f4" } ], "additionalParamForNs":{ - "externalDataNetworkName":"Flow_out_net", - "m6000_mng_ip":"192.168.20.2", - "externalCompanyFtpDataNetworkName":"Flow_out_net", - "externalPluginManageNetworkName":"plugin_net_2014", - "externalManageNetworkName":"mng_net_2017", - "sfc_data_network":"sfc_data_net_2016", - "NatIpRange":"210.1.1.10-210.1.1.20", - "location":"4050083f-465f-4838-af1e-47a545222ad0", - "sdncontroller":"9b9f02c0-298b-458a-bc9c-be3692e4f35e" + "orchestrator":"", + "nfvo":"b1bb0ce7-2222-4fa7-95ed-4840d70a1101", + "nf_naming":"true", + "multi_stage_design":"false", + "availability_zone_max_count":"1", + "xyz":"123", + "nsd0_providing_service_invariant_uuid":"12204a12-7da2-4ddf-8c2f-992a1a1acebf", + "nsd0_providing_service_uuid":"5791dbeb-19d4-43e8-bf44-5b327ccf6bca" } } -}
\ No newline at end of file +} diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json b/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json new file mode 100644 index 0000000000..938969a87f --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/resources/json/createNsSol005Response.json @@ -0,0 +1,210 @@ +{ + "_links":{ + "heal":{ + "href":"" + }, + "instantiate":{ + "href":"" + }, + "nestedNsInstances":{ + "href":"" + }, + "scale":{ + "href":"" + }, + "self":{ + "href":"" + }, + "terminate":{ + "href":"" + }, + "update":{ + "href":"" + } + }, + "additionalAffinityOrAntiAffiniityRule":[ + { + "Scope":"", + "affinityOrAntiAffiinty":"", + "vnfInstanceId":[ + + ], + "vnfProfileId":[ + + ], + "vnfdId":[ + + ] + } + ], + "flavourId":"", + "id":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d", + "nestedNsInstanceId":[ + + ], + "nsInstanceDescription":"", + "nsInstanceName":"", + "nsScaleStatus":[ + { + "nsScaleLevelId":"", + "nsScalingAspectId":"" + } + ], + "nsState":"", + "nsdId":"", + "nsdInfoId":"", + "pnfInfo":[ + { + "cpInfo":[ + { + "cpInstanceId":"", + "cpProtocolData":{ + "ipOverEthernet":{ + "ipAddresses":{ + "addressRange":{ + "maxAddress":"", + "minAddress":"" + }, + "fixedAddresses":"", + "numDynamicAddresses":1, + "subnetId":"", + "type":"" + }, + "macAddress":{ + + } + }, + "layerProtocol":"IP_OVER_ETHERNET" + }, + "cpdId":"" + } + ], + "pnfId":"", + "pnfName":"", + "pnfProfileId":"", + "pnfdId":"", + "pnfdInfoId":"" + } + ], + "sapInfo":[ + { + "description":"", + "id":"", + "sapName":"", + "sapProtocolInfo":{ + "ipOverEthernet":{ + "ipAddresses":{ + "addressRange":{ + "maxAddress":"", + "minAddress":"" + }, + "fixedAddresses":"", + "numDynamicAddresses":1, + "subnetId":"", + "type":"" + }, + "macAddress":"" + }, + "layerProtocol":"IP_OVER_ETHERNET" + }, + "sapdId":"" + } + ], + "virtualLinkInfo":[ + { + "id":"", + "linkPort":[ + { + "id":"", + "resourceHandle":{ + "resourceId":"", + "resourceProviderId":"", + "vimId":"", + "vimLevelResourceType":"" + } + } + ], + "nsVirtualLinkDescId":"", + "resourceHandle":[ + { + "resourceId":"", + "resourceProviderId":"", + "vimId":"", + "vimLevelResourceType":"" + } + ] + } + ], + "vnfInstance":[ + { + "vnfInstanceId":"", + "vnfProfileId":"" + } + ], + "vnffgInfo":[ + { + "id":"", + "nfpInfo":[ + { + "description":"", + "id":"", + "nfpName":"", + "nfpRule":{ + "destinationIpAddressPrefix":"", + "destinationPortRange":"", + "dscp":"", + "etherDestinationAddress":"", + "etherSourceAddress":"", + "etherType":"", + "extendedCriteria":[ + { + "length":1, + "startingPoint":1, + "value":"" + } + ], + "protocol":"", + "sourceIpAddressPrefix":"", + "sourcePortRange":"", + "vlanTag":[ + + ] + }, + "nfpState":"", + "nfpdId":"", + "nscpHandle":[ + { + "nsInstanceId":"", + "nsSapInstanceId":"", + "pnfExtCpInstanceId":"", + "pnfInfoId":"", + "vnfExtCpInstanceId":"", + "vnfInstanceId":"" + } + ], + "totalCp":1 + } + ], + "nsCpHandle":[ + { + "nsInstanceId":"", + "nsSapInstanceId":"", + "pnfExtCpInstanceId":"", + "pnfInfoId":"", + "vnfExtCpInstanceId":"", + "vnfInstanceId":"" + } + ], + "nsVirtualLinkInfoId":[ + + ], + "pnfInfoId":[ + + ], + "vnfInstanceId":[ + + ], + "vnffgdId":"" + } + ] +}
\ No newline at end of file diff --git a/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json b/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json new file mode 100644 index 0000000000..111afc1a7c --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/resources/json/lcmOperRsp.json @@ -0,0 +1,7 @@ +{ + "id":"12204a12-7da2-4ddf-8c2f-992a1a1acebf", + "lcmOperationType":"INSTANTIATE", + "nsInstanceId":"c9f0a95e-dea0-4698-96e5-5a79bc5a233d", + "operationState":"PROCESSING", + "statusEnteredTime":"Time" +}
\ No newline at end of file |