aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest
diff options
context:
space:
mode:
authorleventecsanyi <levente.csanyi@est.tech>2023-09-08 15:52:24 +0200
committerleventecsanyi <levente.csanyi@est.tech>2023-09-18 18:05:38 +0200
commite5cdeae638105b2a3a191fc2273c63d73ff8503c (patch)
tree404c777717985eae23d6a34d1240b5207cdc28cf /cps-ncmp-rest
parente2db79981081bc86cbb836d6cdca8720c9d21383 (diff)
Set lock state and reason upon request
- added new LockReasonCategories and improved SyncUtils.isReadyForRetry - refactored logic aroudn retry times - refactored unit tests Issue-ID: CPS-1860 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I4382d6ad1fa0a7d9dacb8c8281b0458a5afc0375
Diffstat (limited to 'cps-ncmp-rest')
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy2
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy8
2 files changed, 5 insertions, 5 deletions
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
index 7964e32b6f..6887d1974f 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
@@ -600,7 +600,7 @@ class NetworkCmProxyControllerSpec extends Specification {
def compositeStateTestObject() {
new CompositeState(cmHandleState: CmHandleState.ADVISED,
- lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
+ lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
lastUpdateTime: formattedDateAndTime.toString(),
dataSyncEnabled: false,
dataStores: dataStores())
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy
index 9a09b97973..bc9ea80bd2 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy
@@ -43,7 +43,7 @@ class CmHandleStateMapperSpec extends Specification {
def compositeState = new CompositeStateBuilder()
.withCmHandleState(CmHandleState.ADVISED)
.withLastUpdatedTime(formattedDateAndTime.toString())
- .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'locked details')
+ .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED, 'locked details')
.withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, formattedDateAndTime).build()
compositeState.setDataSyncEnabled(false)
when: 'mapper is called'
@@ -74,9 +74,9 @@ class CmHandleStateMapperSpec extends Specification {
then: 'the composite state contains the expected lock Reason and details'
result.getLockReason().getReason() == expectedExternalLockReason
where:
- scenario | lockReason || expectedExternalLockReason
- 'LOCKED_MODULE_SYNC_FAILED' | LockReasonCategory.LOCKED_MODULE_SYNC_FAILED || 'LOCKED_MISBEHAVING'
- 'null value' | null || null
+ scenario | lockReason || expectedExternalLockReason
+ 'MODULE_SYNC_FAILED' | LockReasonCategory.MODULE_SYNC_FAILED || 'LOCKED_MISBEHAVING'
+ 'null value' | null || null
}
}