summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main
diff options
context:
space:
mode:
authoreh552t <eh552t@intl.att.com>2017-02-09 16:38:55 +0100
committereh552t <eh552t@intl.att.com>2017-02-09 16:38:55 +0100
commit42c578ff3926933833b6390f880d5954b5d931df (patch)
treeca9e74f120271d3e2cca0c759ddec5780e7f9cd2 /mso-api-handlers/mso-api-handler-infra/src/main
parent4ec8b3f1cac37a85d2d3b7f9e0d3f6c6d9971950 (diff)
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 <eh552t@intl.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java104
1 files changed, 56 insertions, 48 deletions
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);