From 42c578ff3926933833b6390f880d5954b5d931df Mon Sep 17 00:00:00 2001 From: eh552t Date: Thu, 9 Feb 2017 16:38:55 +0100 Subject: SoapUI tests for APIH Infra Added some soapUI tests for testing APIH Infra in Arquilian. Some bug fixes in the Tenant Adapter and VNF adapter SoapUIs. BugFix in case of bad ModelType in a request we gor null pointer Exception. Change-Id: Icf9b8fc344d15860ac8dd11984894b07ecf5b085 Signed-off-by: eh552t --- .../openecomp/mso/apihandlerinfra/MsoRequest.java | 104 +++++++++++---------- 1 file changed, 56 insertions(+), 48 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java index 55c12eb6ff..606c3c677e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java @@ -513,6 +513,10 @@ public class MsoRequest { session = HibernateUtil.getSessionFactory ().openSession (); session.beginTransaction (); + if (null == sir) { + sir = new ServiceInstancesRequest (); + } + InfraActiveRequests aq = new InfraActiveRequests (); aq.setRequestId (requestId); @@ -559,54 +563,58 @@ public class MsoRequest { if(sir.getVnfInstanceId() != null){ aq.setVnfId(sir.getVnfInstanceId()); } - - - if(requestScope.equalsIgnoreCase(ModelType.service.name())){ - if(requestInfo.getInstanceName() != null){ - aq.setServiceInstanceName(requestInfo.getInstanceName()); - } - } - - if(requestScope.equalsIgnoreCase(ModelType.network.name())){ - aq.setNetworkName(requestInfo.getInstanceName()); - aq.setNetworkType(networkType); - aq.setNetworkId(sir.getNetworkInstanceId()); - } - - if(requestScope.equalsIgnoreCase(ModelType.volumeGroup.name())){ - aq.setVolumeGroupId(sir.getVolumeGroupInstanceId()); - aq.setVolumeGroupName(requestInfo.getInstanceName()); - aq.setVnfType(vnfType); - - } - - if(requestScope.equalsIgnoreCase(ModelType.vfModule.name())){ - aq.setVfModuleName(requestInfo.getInstanceName()); - aq.setVfModuleModelName(modelInfo.getModelName()); - aq.setVfModuleId(sir.getVfModuleInstanceId()); - aq.setVolumeGroupId(sir.getVolumeGroupInstanceId()); - aq.setVnfType(vnfType); - - } - - if(requestScope.equalsIgnoreCase(ModelType.vnf.name())){ - aq.setVnfName(requestInfo.getInstanceName()); - RelatedInstanceList[] instanceList = sir.getRequestDetails().getRelatedInstanceList(); - - if (instanceList != null) { - - for(RelatedInstanceList relatedInstanceList : instanceList){ - - RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); - if(relatedInstance.getModelInfo().getModelType().equals(ModelType.service)){ - aq.setVnfType(vnfType); - } - } - } - //aq.setVnfType(sir.getRequestDetails().getRelatedInstanceList()); - - } - + + if (null != requestScope) { + if (requestScope.equalsIgnoreCase(ModelType.service.name())) { + if (requestInfo.getInstanceName() != null) { + aq.setServiceInstanceName(requestInfo.getInstanceName()); + } + } + + if (requestScope.equalsIgnoreCase(ModelType.network.name())) { + aq.setNetworkName(requestInfo.getInstanceName()); + aq.setNetworkType(networkType); + aq.setNetworkId(sir.getNetworkInstanceId()); + + } + + if (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name())) { + aq.setVolumeGroupId(sir.getVolumeGroupInstanceId()); + aq.setVolumeGroupName(requestInfo.getInstanceName()); + aq.setVnfType(vnfType); + + } + + if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { + aq.setVfModuleName(requestInfo.getInstanceName()); + aq.setVfModuleModelName(modelInfo.getModelName()); + aq.setVfModuleId(sir.getVfModuleInstanceId()); + aq.setVolumeGroupId(sir.getVolumeGroupInstanceId()); + aq.setVnfType(vnfType); + + } + + if (requestScope.equalsIgnoreCase(ModelType.vnf.name())) { + aq.setVnfName(requestInfo.getInstanceName()); + if (null != sir.getRequestDetails()) { + RelatedInstanceList[] instanceList = sir.getRequestDetails().getRelatedInstanceList(); + + if (instanceList != null) { + + for (RelatedInstanceList relatedInstanceList : instanceList) { + + RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); + if (relatedInstance.getModelInfo().getModelType().equals(ModelType.service)) { + aq.setVnfType(vnfType); + } + } + } + } + //aq.setVnfType(sir.getRequestDetails().getRelatedInstanceList()); + + } + } + aq.setRequestBody (this.requestJSON); -- cgit 1.2.3-korg