summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra
diff options
context:
space:
mode:
authorPlummer, Brittany <brittany.plummer@att.com>2019-06-26 10:58:22 -0400
committerMax Benjamin <max.benjamin@att.com>2019-06-27 16:08:30 +0000
commitb75b28b8e56f19203cb6cce8ffeeaa771b9b60d8 (patch)
tree6b956dd1d63d208482c565842ea2f9ac9ca1411f /mso-api-handlers/mso-api-handler-infra
parent5c58eeca5ffd8b080b9af7619a903eb0acff3a0d (diff)
add rollback ext system error source
Added rollbackExtSystemErrorSource column and updated GET orchestrationRequests response Added missing columns from requestDb to schema.sql Change-Id: I2380f08b9bb1c86922e8faea70454df722c0873a Issue-ID: SO-2054 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java16
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql5
3 files changed, 10 insertions, 12 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
index b4a3128de8..b63e3916f3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
@@ -440,6 +440,7 @@ public class OrchestrationRequests {
boolean extSystemErrorSource) {
if (extSystemErrorSource) {
status.setExtSystemErrorSource(iar.getExtSystemErrorSource());
+ status.setRollbackExtSystemErrorSource(iar.getRollbackExtSystemErrorSource());
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
index a400caeae2..99ff4ffe9e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
@@ -29,8 +29,6 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
@@ -74,19 +72,13 @@ public class OrchestrationRequestsUnitTest {
private static final String ORIGINAL_REQUEST_ID = "8f2d38a6-7c20-465a-bd7e-075645f1394b";
private static final String SERVICE = "service";
private static final String EXT_SYSTEM_ERROR_SOURCE = "external system error source";
+ private static final String ROLLBACK_EXT_SYSTEM_ERROR_SOURCE = "SDNC";
private InfraActiveRequests iar;
boolean includeCloudRequest = false;
boolean extSystemErrorSource = false;
- private static final String SERVICE_INSTANCE_NAME = "serviceInstanceName";
- private static final String VNF_ID = "00032ab7-na18-42e5-965d-8ea592502017";
- private static final String VFMODULE_ID = "00032ab7-na18-42e5-965d-8ea592502016";
- private static final String NETWORK_ID = "00032ab7-na18-42e5-965d-8ea592502015";
- private static final String VOLUME_GROUP_ID = "00032ab7-na18-42e5-965d-8ea592502014";
- private static final String VNF_NAME = "vnfName";
- private static final String VFMODULE_NAME = "vfModuleName";
- private static final String NETWORK_NAME = "networkName";
- private static final String VOLUME_GROUP_NAME = "volumeGroupName";
+
private static final String VERSION = "v7";
+
List<org.onap.so.db.request.beans.RequestProcessingData> requestProcessingData = new ArrayList<>();
@Before
@@ -164,6 +156,7 @@ public class OrchestrationRequestsUnitTest {
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
requestStatus.setExtSystemErrorSource(EXT_SYSTEM_ERROR_SOURCE);
+ requestStatus.setRollbackExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
Request expected = new Request();
expected.setRequestId(REQUEST_ID);
@@ -174,6 +167,7 @@ public class OrchestrationRequestsUnitTest {
extSystemErrorSource = true;
includeCloudRequest = false;
iar.setExtSystemErrorSource(EXT_SYSTEM_ERROR_SOURCE);
+ iar.setRollbackExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
Request actual =
orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest, extSystemErrorSource);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
index 948283453b..731d2bec4d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
@@ -1290,7 +1290,10 @@ CREATE TABLE `infra_active_requests` (
`CONFIGURATION_NAME` varchar(200) DEFAULT NULL,
`OPERATIONAL_ENV_ID` varchar(45) DEFAULT NULL,
`OPERATIONAL_ENV_NAME` varchar(200) DEFAULT NULL,
- `REQUEST_URL` varchar(500) DEFAULT NULL,
+ `REQUEST_URL` varchar(500) DEFAULT NULL,
+ `ORIGINAL_REQUEST_ID` varchar(45) DEFAULT NULL,
+ `EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
+ `ROLLBACK_EXT_SYSTEM_ERROR_SOURCE` varchar(80) DEFAULT NULL,
PRIMARY KEY (`REQUEST_ID`),
UNIQUE KEY `UK_bhu6w8p7wvur4pin0gjw2d5ak` (`CLIENT_REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;