aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db-repositories
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 /mso-api-handlers/mso-requests-db-repositories
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 'mso-api-handlers/mso-requests-db-repositories')
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java5
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
index bcad9ce6d5..ecf1dcb183 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
@@ -37,7 +37,8 @@ public interface OperationalEnvServiceModelStatusRepository extends JpaRepositor
public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndRequestId(String operationalEnvId, String requestId);
public List<OperationalEnvServiceModelStatus> findAllByOperationalEnvIdAndRequestId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId,
@Param("REQUEST_ID") String requestId);
- public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId,
- @Param("SERVICE_MODEL_VERSION_ID") String serviceModelVersionId);
+ public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(@Param("OPERATIONAL_ENV_ID") String operationalEnvId,
+ @Param("SERVICE_MODEL_VERSION_ID") String serviceModelVersionId,
+ @Param("REQUEST_ID") String requestId);
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
index ef3466278e..9eec860cc9 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
@@ -54,8 +54,9 @@ public class OperationalEnvServiceModelStatusTest {
status.setRetryCount(0);
repository.saveAndFlush(status);
- OperationalEnvServiceModelStatus status2 = repository.findOneByOperationalEnvIdAndServiceModelVersionId("oper-env-id-1", "service-model-ver-id-1");
+ OperationalEnvServiceModelStatus status2 = repository.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId("oper-env-id-1", "service-model-ver-id-1", "request-id-1");
status2.setRetryCount(1);
+ assertEquals("request-id-1", status2.getRequestId());
repository.saveAndFlush(status2);