From 8ed112cc25f33315e453b238478c4a1fde3e257e Mon Sep 17 00:00:00 2001 From: Rich Tabedzki Date: Mon, 23 Apr 2018 15:50:06 -0400 Subject: Fixing trustStore issues in AAI Client Changes made: * Updated AAI XSD model to v13 * Updated AAI interface path definitions Change-Id: I047845e574734b45dda67e1f84b3bb07dacca426 Issue-ID: CCSDK-247 Signed-off-by: Rich Tabedzki --- .../ccsdk/sli/adaptors/aai/AAIServiceTest.java | 2 +- .../adaptors/aai/AutoGeneratedRegressionTest.java | 2 +- .../ccsdk/sli/adaptors/aai/GenericRequestTest.java | 2 +- .../ccsdk/sli/adaptors/aai/GenericVnfTest.java | 2 +- .../sli/adaptors/aai/data/ResponseMessageTest.java | 119 +++++---- .../sli/adaptors/aai/data/SubInterfaceTest.java | 189 +++++++------- .../sli/adaptors/aai/query/InstanceFilterTest.java | 225 ++++++++-------- .../adaptors/aai/query/InstanceFiltersTest.java | 74 +++--- .../ccsdk/sli/adaptors/aai/query/ResultTest.java | 284 ++++++++++----------- 9 files changed, 446 insertions(+), 453 deletions(-) (limited to 'aai-service/provider/src/test/java') diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceTest.java index 011b926c..5be8a73e 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceTest.java @@ -51,7 +51,7 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.openecomp.aai.inventory.v11.*; +import org.openecomp.aai.inventory.v13.*; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java index 9bc93609..0e616d57 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java @@ -63,7 +63,7 @@ import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; import org.onap.ccsdk.sli.adaptors.aai.query.NamedQueryData; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; -import org.openecomp.aai.inventory.v11.GenericVnf; +import org.openecomp.aai.inventory.v13.GenericVnf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.annotation.AnnotationUtils; diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequestTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequestTest.java index eb84cfdf..eaedf66f 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequestTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequestTest.java @@ -38,7 +38,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.LInterface; +import org.openecomp.aai.inventory.v13.LInterface; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java index afdc4d26..8ed704d7 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java @@ -49,7 +49,7 @@ import org.onap.ccsdk.sli.adaptors.aai.AAIRequest; import org.onap.ccsdk.sli.adaptors.aai.AAIService; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; -import org.openecomp.aai.inventory.v11.GenericVnf; +import org.openecomp.aai.inventory.v13.GenericVnf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessageTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessageTest.java index 04c9963b..daf95b02 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessageTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessageTest.java @@ -1,71 +1,68 @@ -package org.onap.ccsdk.sli.adaptors.aai.data; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +package org.onap.ccsdk.sli.adaptors.aai.data; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; + +import java.util.HashMap; +import java.util.Map; + import org.junit.After; import org.junit.Before; -import org.junit.Test; -import org.openecomp.aai.inventory.v11.Vlans; +import org.junit.Test; + +public class ResponseMessageTest { + + ResponseMessage _rmInstance; + protected String _messageId; + protected String _text; + protected Variables _variables; + protected Map _additionalProperties; -public class ResponseMessageTest { - - ResponseMessage _rmInstance; - protected String _messageId; - protected String _text; - protected Variables _variables; - protected Map _additionalProperties; - - @Before - public void setUp() throws Exception { - _rmInstance = new ResponseMessage(); - _messageId = "messageId"; - _text = "text"; - _variables = mock(Variables.class); - _additionalProperties = new HashMap() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } + @Before + public void setUp() throws Exception { + _rmInstance = new ResponseMessage(); + _messageId = "messageId"; + _text = "text"; + _variables = mock(Variables.class); + _additionalProperties = new HashMap() {{ + put("prop1", "propvalue1"); + put("prop2", "propvalue2"); + }}; + } - @After - public void tearDown() throws Exception { - _rmInstance = null; - _messageId = null; - _text = null; - _variables = null; - _additionalProperties = null; - } + @After + public void tearDown() throws Exception { + _rmInstance = null; + _messageId = null; + _text = null; + _variables = null; + _additionalProperties = null; + } - @Test - public void testSetMessageId() { - _rmInstance.setMessageId(_messageId); - assertTrue(_rmInstance.getMessageId().equals(_messageId)); - } + @Test + public void testSetMessageId() { + _rmInstance.setMessageId(_messageId); + assertTrue(_rmInstance.getMessageId().equals(_messageId)); + } - @Test - public void testSetText() { - _rmInstance.setText(_text); - assertTrue(_rmInstance.getText().equals(_text)); - } + @Test + public void testSetText() { + _rmInstance.setText(_text); + assertTrue(_rmInstance.getText().equals(_text)); + } - @Test - public void testSetVariables() { - _rmInstance.setVariables(_variables); - assertEquals(_rmInstance.getVariables(), _variables); - } + @Test + public void testSetVariables() { + _rmInstance.setVariables(_variables); + assertEquals(_rmInstance.getVariables(), _variables); + } - @Test - public void testSetAdditionalProperty() { - _rmInstance.setAdditionalProperty("prop1", "propvalue1"); - _rmInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_rmInstance.getAdditionalProperties(), _additionalProperties); - } + @Test + public void testSetAdditionalProperty() { + _rmInstance.setAdditionalProperty("prop1", "propvalue1"); + _rmInstance.setAdditionalProperty("prop2", "propvalue2"); + assertEquals(_rmInstance.getAdditionalProperties(), _additionalProperties); + } } diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/SubInterfaceTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/SubInterfaceTest.java index 66717103..21fc86d1 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/SubInterfaceTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/data/SubInterfaceTest.java @@ -1,95 +1,94 @@ -package org.onap.ccsdk.sli.adaptors.aai.data; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openecomp.aai.inventory.v11.RelationshipList; -import org.openecomp.aai.inventory.v11.Vlans; - -public class SubInterfaceTest { - - SubInterface _siInstance; - protected String _interfaceName; - protected String _interfaceRole; - protected String _resourceVersion; - protected Vlans _vlans; - protected RelationshipList _relationshipList; - protected Map _additionalProperties; - - @Before - public void setUp() throws Exception { - _siInstance = new SubInterface(); - _interfaceName = "interfaceName"; - _interfaceRole = "interfaceRole"; - _resourceVersion = "resourceVersion"; - _vlans = mock(Vlans.class); - _relationshipList = mock(RelationshipList.class); - - _additionalProperties = new HashMap() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - - } - - @After - public void tearDown() throws Exception { - _siInstance = null; - _interfaceName = null; - _interfaceRole = null; - _resourceVersion = null; - _vlans = null; - _relationshipList = null; - _additionalProperties = null; - } - - @Test - public void testSetInterfaceName() { - _siInstance.setInterfaceName(_interfaceName); - assertTrue(_siInstance.getInterfaceName().equals(_interfaceName)); - } - - - @Test - public void testSetInterfaceRole() { - _siInstance.setInterfaceRole(_interfaceRole); - assertTrue(_siInstance.getInterfaceRole().equals(_interfaceRole)); - } - - - @Test - public void testSetResourceVersion() { - _siInstance.setResourceVersion(_resourceVersion); - assertTrue(_siInstance.getResourceVersion().equals(_resourceVersion)); - } - - - @Test - public void testSetVlans() { - _siInstance.setVlans(_vlans); - assertTrue(_siInstance.getVlans().equals(_vlans)); - } - - - @Test - public void testSetRelationshipList() { - _siInstance.setRelationshipList(_relationshipList); - assertTrue(_siInstance.getRelationshipList().equals(_relationshipList)); - } - - @Test - public void testSetAdditionalProperties() { - _siInstance.setAdditionalProperty("prop1", "propvalue1"); - _siInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_siInstance.getAdditionalProperties(), _additionalProperties); - } - -} +package org.onap.ccsdk.sli.adaptors.aai.data; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.openecomp.aai.inventory.v13.RelationshipList; +import org.openecomp.aai.inventory.v13.Vlans; + +public class SubInterfaceTest { + + SubInterface _siInstance; + protected String _interfaceName; + protected String _interfaceRole; + protected String _resourceVersion; + protected Vlans _vlans; + protected RelationshipList _relationshipList; + protected Map _additionalProperties; + + @Before + public void setUp() throws Exception { + _siInstance = new SubInterface(); + _interfaceName = "interfaceName"; + _interfaceRole = "interfaceRole"; + _resourceVersion = "resourceVersion"; + _vlans = mock(Vlans.class); + _relationshipList = mock(RelationshipList.class); + + _additionalProperties = new HashMap() {{ + put("prop1", "propvalue1"); + put("prop2", "propvalue2"); + }}; + + } + + @After + public void tearDown() throws Exception { + _siInstance = null; + _interfaceName = null; + _interfaceRole = null; + _resourceVersion = null; + _vlans = null; + _relationshipList = null; + _additionalProperties = null; + } + + @Test + public void testSetInterfaceName() { + _siInstance.setInterfaceName(_interfaceName); + assertTrue(_siInstance.getInterfaceName().equals(_interfaceName)); + } + + + @Test + public void testSetInterfaceRole() { + _siInstance.setInterfaceRole(_interfaceRole); + assertTrue(_siInstance.getInterfaceRole().equals(_interfaceRole)); + } + + + @Test + public void testSetResourceVersion() { + _siInstance.setResourceVersion(_resourceVersion); + assertTrue(_siInstance.getResourceVersion().equals(_resourceVersion)); + } + + + @Test + public void testSetVlans() { + _siInstance.setVlans(_vlans); + assertTrue(_siInstance.getVlans().equals(_vlans)); + } + + + @Test + public void testSetRelationshipList() { + _siInstance.setRelationshipList(_relationshipList); + assertTrue(_siInstance.getRelationshipList().equals(_relationshipList)); + } + + @Test + public void testSetAdditionalProperties() { + _siInstance.setAdditionalProperty("prop1", "propvalue1"); + _siInstance.setAdditionalProperty("prop2", "propvalue2"); + assertEquals(_siInstance.getAdditionalProperties(), _additionalProperties); + } + +} diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilterTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilterTest.java index 1bc226ec..2a115d70 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilterTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilterTest.java @@ -1,127 +1,124 @@ package org.onap.ccsdk.sli.adaptors.aai.query; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.Test; - -import org.openecomp.aai.inventory.v11.CloudRegion; -import org.openecomp.aai.inventory.v11.GenericVnf; -import org.openecomp.aai.inventory.v11.L3Network; -import org.openecomp.aai.inventory.v11.Pnf; -import org.openecomp.aai.inventory.v11.LogicalLink; -import org.openecomp.aai.inventory.v11.PInterface; -import org.openecomp.aai.inventory.v11.ServiceInstance; -import org.openecomp.aai.inventory.v11.Tenant; -import org.openecomp.aai.inventory.v11.Vnf; -import org.openecomp.aai.inventory.v11.Vserver; +import org.openecomp.aai.inventory.v13.CloudRegion; +import org.openecomp.aai.inventory.v13.GenericVnf; +import org.openecomp.aai.inventory.v13.L3Network; +import org.openecomp.aai.inventory.v13.LogicalLink; +import org.openecomp.aai.inventory.v13.PInterface; +import org.openecomp.aai.inventory.v13.Pnf; +import org.openecomp.aai.inventory.v13.ServiceInstance; +import org.openecomp.aai.inventory.v13.Tenant; +import org.openecomp.aai.inventory.v13.Vnf; +import org.openecomp.aai.inventory.v13.Vserver; public class InstanceFilterTest { - - InstanceFilter _ifInstance; - protected LogicalLink _logicalLink; - protected Pnf _pnf; - protected L3Network _l3Network; - protected PInterface _pInterface; - protected GenericVnf _genericVnf; - protected Vserver _vserver; - protected Tenant _tenant; - protected CloudRegion _cloudRegion; - protected ServiceInstance _serviceInstance; - protected Vnf _vnfc; - protected Map _additionalProperties; - - @Before - public void setUp() throws Exception { - _ifInstance = new InstanceFilter(); - LogicalLink _logicalLink = mock(LogicalLink.class); - Pnf _pnf = mock(Pnf.class); - L3Network _l3Network = mock(L3Network.class); - PInterface _pInterface = mock(PInterface.class); - GenericVnf _genericVnf = mock(GenericVnf.class); - Vserver _vserver = mock(Vserver.class); - Tenant _tenant = mock(Tenant.class); - CloudRegion _cloudRegion = mock(CloudRegion.class); - ServiceInstance _serviceInstance = mock(ServiceInstance.class); - // as per class - Vnf _vnfc = mock(Vnf.class); - _additionalProperties = new HashMap() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _ifInstance = null; - _additionalProperties = null; - } - - @Test - public void testSetLogicalLink() { - _ifInstance.setLogicalLink(_logicalLink); - assertEquals(_ifInstance.getLogicalLink(), _logicalLink); - } - - @Test - public void testSetPnf() { - _ifInstance.setPnf(_pnf); - assertEquals(_ifInstance.getPnf(), _pnf); - } - - @Test - public void testSetL3Network() { - _ifInstance.setL3Network(_l3Network); - assertEquals(_ifInstance.getL3Network(), _l3Network); - } - - @Test - public void testSetServiceInstance() { - _ifInstance.setServiceInstance(_serviceInstance); - assertEquals(_ifInstance.getServiceInstance(), _serviceInstance); - } - - @Test - public void testSetGenericVnf() { - _ifInstance.setGenericVnf(_genericVnf); - assertEquals(_ifInstance.getGenericVnf(), _genericVnf); - } - - @Test - public void testSetVserver() { - _ifInstance.setVserver(_vserver); - assertEquals(_ifInstance.getVserver(), _vserver); - } - - @Test - public void testSetTenant() { - _ifInstance.setTenant(_tenant); - assertEquals(_ifInstance.getTenant(), _tenant); - } - - @Test - public void testSetCloudRegion() { - _ifInstance.setCloudRegion(_cloudRegion); - assertEquals(_ifInstance.getCloudRegion(), _cloudRegion); - } - - @Test - public void testSetVnfc() { - _ifInstance.setVnfc(_vnfc); - assertEquals(_ifInstance.getVnfc(), _vnfc); - } - - @Test - public void testSetAdditionalProperty() { - _ifInstance.setAdditionalProperty("prop1", "propvalue1"); - _ifInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_ifInstance.getAdditionalProperties(), _additionalProperties); - } + + InstanceFilter _ifInstance; + protected LogicalLink _logicalLink; + protected Pnf _pnf; + protected L3Network _l3Network; + protected PInterface _pInterface; + protected GenericVnf _genericVnf; + protected Vserver _vserver; + protected Tenant _tenant; + protected CloudRegion _cloudRegion; + protected ServiceInstance _serviceInstance; + protected Vnf _vnfc; + protected Map _additionalProperties; + + @Before + public void setUp() throws Exception { + _ifInstance = new InstanceFilter(); + LogicalLink _logicalLink = mock(LogicalLink.class); + Pnf _pnf = mock(Pnf.class); + L3Network _l3Network = mock(L3Network.class); + PInterface _pInterface = mock(PInterface.class); + GenericVnf _genericVnf = mock(GenericVnf.class); + Vserver _vserver = mock(Vserver.class); + Tenant _tenant = mock(Tenant.class); + CloudRegion _cloudRegion = mock(CloudRegion.class); + ServiceInstance _serviceInstance = mock(ServiceInstance.class); + // as per class + Vnf _vnfc = mock(Vnf.class); + _additionalProperties = new HashMap() {{ + put("prop1", "propvalue1"); + put("prop2", "propvalue2"); + }}; + } + + @After + public void tearDown() throws Exception { + _ifInstance = null; + _additionalProperties = null; + } + + @Test + public void testSetLogicalLink() { + _ifInstance.setLogicalLink(_logicalLink); + assertEquals(_ifInstance.getLogicalLink(), _logicalLink); + } + + @Test + public void testSetPnf() { + _ifInstance.setPnf(_pnf); + assertEquals(_ifInstance.getPnf(), _pnf); + } + + @Test + public void testSetL3Network() { + _ifInstance.setL3Network(_l3Network); + assertEquals(_ifInstance.getL3Network(), _l3Network); + } + + @Test + public void testSetServiceInstance() { + _ifInstance.setServiceInstance(_serviceInstance); + assertEquals(_ifInstance.getServiceInstance(), _serviceInstance); + } + + @Test + public void testSetGenericVnf() { + _ifInstance.setGenericVnf(_genericVnf); + assertEquals(_ifInstance.getGenericVnf(), _genericVnf); + } + + @Test + public void testSetVserver() { + _ifInstance.setVserver(_vserver); + assertEquals(_ifInstance.getVserver(), _vserver); + } + + @Test + public void testSetTenant() { + _ifInstance.setTenant(_tenant); + assertEquals(_ifInstance.getTenant(), _tenant); + } + + @Test + public void testSetCloudRegion() { + _ifInstance.setCloudRegion(_cloudRegion); + assertEquals(_ifInstance.getCloudRegion(), _cloudRegion); + } + + @Test + public void testSetVnfc() { + _ifInstance.setVnfc(_vnfc); + assertEquals(_ifInstance.getVnfc(), _vnfc); + } + + @Test + public void testSetAdditionalProperty() { + _ifInstance.setAdditionalProperty("prop1", "propvalue1"); + _ifInstance.setAdditionalProperty("prop2", "propvalue2"); + assertEquals(_ifInstance.getAdditionalProperties(), _additionalProperties); + } } diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFiltersTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFiltersTest.java index e44e8454..6131e13e 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFiltersTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFiltersTest.java @@ -14,42 +14,42 @@ import org.junit.Test; public class InstanceFiltersTest { - InstanceFilters _ifsInstance; - protected List _instanceFilter; - protected Map _additionalProperties; - - @Before - public void setUp() throws Exception { - _ifsInstance = new InstanceFilters(); - _instanceFilter = new ArrayList<>(); - InstanceFilter if1 = mock(InstanceFilter.class); - InstanceFilter if2 = mock(InstanceFilter.class); - _instanceFilter.add(if1); - _instanceFilter.add(if2); - _additionalProperties = new HashMap() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _ifsInstance = null; - _instanceFilter = null; - _additionalProperties = null; - } - - @Test - public void testSetInstanceFilter() { - _ifsInstance.setInstanceFilter(_instanceFilter); - assertEquals(_ifsInstance.getInstanceFilter(), _instanceFilter); - - } - - @Test - public void testSetAdditionalProperty() { - _ifsInstance.setAdditionalProperty("prop1", "propvalue1"); - _ifsInstance.setAdditionalProperty("prop2", "propvalue2"); - } + InstanceFilters _ifsInstance; + protected List _instanceFilter; + protected Map _additionalProperties; + + @Before + public void setUp() throws Exception { + _ifsInstance = new InstanceFilters(); + _instanceFilter = new ArrayList<>(); + InstanceFilter if1 = mock(InstanceFilter.class); + InstanceFilter if2 = mock(InstanceFilter.class); + _instanceFilter.add(if1); + _instanceFilter.add(if2); + _additionalProperties = new HashMap() {{ + put("prop1", "propvalue1"); + put("prop2", "propvalue2"); + }}; + } + + @After + public void tearDown() throws Exception { + _ifsInstance = null; + _instanceFilter = null; + _additionalProperties = null; + } + + @Test + public void testSetInstanceFilter() { + _ifsInstance.setInstanceFilter(_instanceFilter); + assertEquals(_ifsInstance.getInstanceFilter(), _instanceFilter); + + } + + @Test + public void testSetAdditionalProperty() { + _ifsInstance.setAdditionalProperty("prop1", "propvalue1"); + _ifsInstance.setAdditionalProperty("prop2", "propvalue2"); + } } diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/ResultTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/ResultTest.java index 4bec9872..576778bb 100644 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/ResultTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/ResultTest.java @@ -10,150 +10,150 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.openecomp.aai.inventory.v11.CloudRegion; -import org.openecomp.aai.inventory.v11.Complex; -import org.openecomp.aai.inventory.v11.Configuration; -import org.openecomp.aai.inventory.v11.GenericVnf; -import org.openecomp.aai.inventory.v11.L3InterfaceIpv4AddressList; -import org.openecomp.aai.inventory.v11.L3InterfaceIpv6AddressList; -import org.openecomp.aai.inventory.v11.L3Network; -import org.openecomp.aai.inventory.v11.LInterface; -//import org.openecomp.aai.inventory.v11.OwningEntity; -import org.openecomp.aai.inventory.v11.Pserver; -import org.openecomp.aai.inventory.v11.ServiceInstance; -import org.openecomp.aai.inventory.v11.Vnfc; -import org.openecomp.aai.inventory.v11.Vserver; +import org.openecomp.aai.inventory.v13.CloudRegion; +import org.openecomp.aai.inventory.v13.Complex; +import org.openecomp.aai.inventory.v13.Configuration; +import org.openecomp.aai.inventory.v13.GenericVnf; +import org.openecomp.aai.inventory.v13.L3InterfaceIpv4AddressList; +import org.openecomp.aai.inventory.v13.L3InterfaceIpv6AddressList; +import org.openecomp.aai.inventory.v13.L3Network; +import org.openecomp.aai.inventory.v13.LInterface; +//import org.openecomp.aai.inventory.v13.OwningEntity; +import org.openecomp.aai.inventory.v13.Pserver; +import org.openecomp.aai.inventory.v13.ServiceInstance; +import org.openecomp.aai.inventory.v13.Vnfc; +import org.openecomp.aai.inventory.v13.Vserver; public class ResultTest { - Result _rInstance; - - protected CloudRegion _cloudRegion; - protected Complex _complex; - protected Configuration _configuration; - protected GenericVnf _genericVnf; - protected L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList; - protected L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList; - protected L3Network _l3Network; - protected LInterface _lInterface; - protected Pserver _pserver; - protected ServiceInstance _serviceInstance; - protected Vnfc _vnfc; - protected Vserver _vserver; - - protected Map _additionalProperties; - - @Before - public void setUp() throws Exception { - _rInstance = new Result(); - - CloudRegion _cloudRegion = mock(CloudRegion.class); - Complex _complex = mock(Complex.class); - Configuration _configuration = mock(Configuration.class); - L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList = mock(L3InterfaceIpv4AddressList.class); - L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList = mock(L3InterfaceIpv6AddressList.class); - L3Network _l3Network = mock(L3Network.class); - LInterface _pInterface = mock(LInterface.class); - GenericVnf _genericVnf = mock(GenericVnf.class); - Vserver _vserver = mock(Vserver.class); - Pserver _pserver = mock(Pserver.class); - Vnfc _vnfc = mock(Vnfc.class); - ServiceInstance _serviceInstance = mock(ServiceInstance.class); - - _additionalProperties = new HashMap() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _rInstance = null; - _additionalProperties = null; - } - - @Test - public void testSetComplex() { - _rInstance.setComplex(_complex); - assertEquals(_rInstance.getComplex(), _complex); - } - - @Test - public void testSetConfiguration() { - _rInstance.setConfiguration(_configuration); - assertEquals(_rInstance.getConfiguration(), _configuration); - } - - @Test - public void testSetL3InterfaceIpv4AddressList() { - _rInstance.setL3InterfaceIpv4AddressList(_l3InterfaceIpv4AddressList); - assertEquals(_rInstance.getL3InterfaceIpv4AddressList(), _l3InterfaceIpv4AddressList); - } - - @Test - public void testSetL3InterfaceIpv6AddressList() { - _rInstance.setL3InterfaceIpv6AddressList(_l3InterfaceIpv6AddressList); - assertEquals(_rInstance.getL3InterfaceIpv6AddressList(), _l3InterfaceIpv6AddressList); - } - - @Test - public void testSetL3Network() { - _rInstance.setL3Network(_l3Network); - assertEquals(_rInstance.getL3Network(), _l3Network); - } - - @Test - public void testSetServiceInstance() { - _rInstance.setServiceInstance(_serviceInstance); - assertEquals(_rInstance.getServiceInstance(), _serviceInstance); - } - - @Test - public void testSetGenericVnf() { - _rInstance.setGenericVnf(_genericVnf); - assertEquals(_rInstance.getGenericVnf(), _genericVnf); - } - - @Test - public void testSetVserver() { - _rInstance.setVserver(_vserver); - assertEquals(_rInstance.getVserver(), _vserver); - } - - @Test - public void testSetCloudRegion() { - _rInstance.setCloudRegion(_cloudRegion); - assertEquals(_rInstance.getCloudRegion(), _cloudRegion); - } - - @Test - public void testSetVnfc() { - _rInstance.setVnfc(_vnfc); - assertEquals(_rInstance.getVnfc(), _vnfc); - } - - @Test - public void testSetLInterface() { - _rInstance.setLInterface(_lInterface); - assertEquals(_rInstance.getLInterface(), _lInterface); - } - - @Test - public void testSetPserver() { - _rInstance.setPserver(_pserver); - assertEquals(_rInstance.getPserver(), _pserver); - } - - @Test - public void testSetAdditionalProperty() { - _rInstance.setAdditionalProperty("prop1", "propvalue1"); - _rInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_rInstance.getAdditionalProperties(), _additionalProperties); - } - - @Test - public void testToString() { - assertNotNull(_rInstance.toString()); - } + Result _rInstance; + + protected CloudRegion _cloudRegion; + protected Complex _complex; + protected Configuration _configuration; + protected GenericVnf _genericVnf; + protected L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList; + protected L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList; + protected L3Network _l3Network; + protected LInterface _lInterface; + protected Pserver _pserver; + protected ServiceInstance _serviceInstance; + protected Vnfc _vnfc; + protected Vserver _vserver; + + protected Map _additionalProperties; + + @Before + public void setUp() throws Exception { + _rInstance = new Result(); + + CloudRegion _cloudRegion = mock(CloudRegion.class); + Complex _complex = mock(Complex.class); + Configuration _configuration = mock(Configuration.class); + L3InterfaceIpv4AddressList _l3InterfaceIpv4AddressList = mock(L3InterfaceIpv4AddressList.class); + L3InterfaceIpv6AddressList _l3InterfaceIpv6AddressList = mock(L3InterfaceIpv6AddressList.class); + L3Network _l3Network = mock(L3Network.class); + LInterface _pInterface = mock(LInterface.class); + GenericVnf _genericVnf = mock(GenericVnf.class); + Vserver _vserver = mock(Vserver.class); + Pserver _pserver = mock(Pserver.class); + Vnfc _vnfc = mock(Vnfc.class); + ServiceInstance _serviceInstance = mock(ServiceInstance.class); + + _additionalProperties = new HashMap() {{ + put("prop1", "propvalue1"); + put("prop2", "propvalue2"); + }}; + } + + @After + public void tearDown() throws Exception { + _rInstance = null; + _additionalProperties = null; + } + + @Test + public void testSetComplex() { + _rInstance.setComplex(_complex); + assertEquals(_rInstance.getComplex(), _complex); + } + + @Test + public void testSetConfiguration() { + _rInstance.setConfiguration(_configuration); + assertEquals(_rInstance.getConfiguration(), _configuration); + } + + @Test + public void testSetL3InterfaceIpv4AddressList() { + _rInstance.setL3InterfaceIpv4AddressList(_l3InterfaceIpv4AddressList); + assertEquals(_rInstance.getL3InterfaceIpv4AddressList(), _l3InterfaceIpv4AddressList); + } + + @Test + public void testSetL3InterfaceIpv6AddressList() { + _rInstance.setL3InterfaceIpv6AddressList(_l3InterfaceIpv6AddressList); + assertEquals(_rInstance.getL3InterfaceIpv6AddressList(), _l3InterfaceIpv6AddressList); + } + + @Test + public void testSetL3Network() { + _rInstance.setL3Network(_l3Network); + assertEquals(_rInstance.getL3Network(), _l3Network); + } + + @Test + public void testSetServiceInstance() { + _rInstance.setServiceInstance(_serviceInstance); + assertEquals(_rInstance.getServiceInstance(), _serviceInstance); + } + + @Test + public void testSetGenericVnf() { + _rInstance.setGenericVnf(_genericVnf); + assertEquals(_rInstance.getGenericVnf(), _genericVnf); + } + + @Test + public void testSetVserver() { + _rInstance.setVserver(_vserver); + assertEquals(_rInstance.getVserver(), _vserver); + } + + @Test + public void testSetCloudRegion() { + _rInstance.setCloudRegion(_cloudRegion); + assertEquals(_rInstance.getCloudRegion(), _cloudRegion); + } + + @Test + public void testSetVnfc() { + _rInstance.setVnfc(_vnfc); + assertEquals(_rInstance.getVnfc(), _vnfc); + } + + @Test + public void testSetLInterface() { + _rInstance.setLInterface(_lInterface); + assertEquals(_rInstance.getLInterface(), _lInterface); + } + + @Test + public void testSetPserver() { + _rInstance.setPserver(_pserver); + assertEquals(_rInstance.getPserver(), _pserver); + } + + @Test + public void testSetAdditionalProperty() { + _rInstance.setAdditionalProperty("prop1", "propvalue1"); + _rInstance.setAdditionalProperty("prop2", "propvalue2"); + assertEquals(_rInstance.getAdditionalProperties(), _additionalProperties); + } + + @Test + public void testToString() { + assertNotNull(_rInstance.toString()); + } } -- cgit 1.2.3-korg