aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-03-13 15:43:33 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-03-13 16:04:51 -0400
commit88953d4f6c0ae360e6fb5d6967fc71dcc3652b4a (patch)
tree91d6e1d0c5d833fbf96f1feac2a9b49a73755c40 /adapters
parent7321d01bda3524066d5a76276a4511554b7a4062 (diff)
Added param requestId to query 1 row
Added param requestId to uniquely query 1 row from model distribution status db. Change-Id: Ice8db174166e6a00d211f191dcf5537eef729127 Issue-ID: SO-1651 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java12
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql3
2 files changed, 13 insertions, 2 deletions
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
index efb5932e51..304b025bf8 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
@@ -218,11 +218,17 @@ public class RequestsDbClientTest {
}
@Test
- public void findOneByOperationalEnvIdAndServiceModelVersionIdTest(){
- OperationalEnvServiceModelStatus operationalEnvServiceModelStatus =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionId("1234","TEST1234");
+ public void findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestIdTest(){
+ OperationalEnvServiceModelStatus operationalEnvServiceModelStatus =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("1234","TEST1234", "00032ab7-3fb3-42e5-965d-8ea592502017");
assertNotNull(operationalEnvServiceModelStatus);
assertEquals("1234",operationalEnvServiceModelStatus.getOperationalEnvId());
assertEquals("TEST1234",operationalEnvServiceModelStatus.getServiceModelVersionId());
+
+ OperationalEnvServiceModelStatus operationalEnvServiceModelStatus1 =requestsDbClient.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("1234","TEST1235", "00032ab7-3fb3-42e5-965d-8ea592502018");
+ assertNotNull(operationalEnvServiceModelStatus1);
+ assertEquals("00032ab7-3fb3-42e5-965d-8ea592502018",operationalEnvServiceModelStatus1.getRequestId());
+ assertEquals("1234",operationalEnvServiceModelStatus1.getOperationalEnvId());
+ assertEquals("TEST1235",operationalEnvServiceModelStatus1.getServiceModelVersionId());
}
@Test
@@ -238,5 +244,7 @@ public class RequestsDbClientTest {
OperationalEnvDistributionStatus operationalEnvDistributionStatus =requestsDbClient.getDistributionStatusById("111");
assertNotNull(operationalEnvDistributionStatus);
assertEquals("111",operationalEnvDistributionStatus.getDistributionId());
+ assertEquals("ERROR",operationalEnvDistributionStatus.getDistributionIdErrorReason());
+ assertEquals("00032ab7-3fb3-42e5-965d-8ea592502017",operationalEnvDistributionStatus.getRequestId());
}
}
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index de1ae85cc6..48d589592f 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -43,6 +43,9 @@ VALUES
INSERT INTO activate_operational_env_service_model_distribution_status (OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID,SERVICE_MOD_VER_FINAL_DISTR_STATUS,RECOVERY_ACTION,RETRY_COUNT_LEFT,WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME)
VALUES
('1234', 'TEST1235', '00032ab7-3fb3-42e5-965d-8ea592502017', "Test", "Test", 2, 'DEFAULT', '2018-08-14 16:50:59', '2018-08-14 16:50:59');
+INSERT INTO activate_operational_env_service_model_distribution_status (OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID, REQUEST_ID,SERVICE_MOD_VER_FINAL_DISTR_STATUS,RECOVERY_ACTION,RETRY_COUNT_LEFT,WORKLOAD_CONTEXT, CREATE_TIME, MODIFY_TIME)
+VALUES
+('1234', 'TEST1235', '00032ab7-3fb3-42e5-965d-8ea592502018', "Test", "Test", 2, 'DEFAULT', '2018-08-14 16:50:59', '2018-08-14 16:50:59');
INSERT INTO `activate_operational_env_per_distributionid_status` (`DISTRIBUTION_ID`, `DISTRIBUTION_ID_STATUS`, `DISTRIBUTION_ID_ERROR_REASON`, `CREATE_TIME`, `MODIFY_TIME`, `OPERATIONAL_ENV_ID`, `SERVICE_MODEL_VERSION_ID`, `REQUEST_ID`)
VALUES