Query CmHandles using CPS path
[cps.git] / cps-ncmp-rest / src / test / groovy / org / onap / cps / ncmp / rest / controller / NetworkCmProxyControllerSpec.groovy
index 729df9c..06a7759 100644 (file)
@@ -416,9 +416,9 @@ class NetworkCmProxyControllerSpec extends Specification {
         then: 'ncmp service method to get module definitions is called'
             mockNetworkCmProxyDataService.getModuleDefinitionsByCmHandleId('some-cmhandle')
                     >> [new ModuleDefinition('sampleModuleName', '2021-10-03',
-                    String.format('module sampleModuleName{ %n sample module content %n }'))]
-        and: 'response contains an array with the module name, revision and content where content contains \\n for newlines'
-            response.getContentAsString() == '[{"moduleName":"sampleModuleName","revision":"2021-10-03","content":"module sampleModuleName{ \\n sample module content \\n }"}]'
+                    'module sampleModuleName{ sample module content }')]
+        and: 'response contains an array with the module name, revision and content'
+            response.getContentAsString() == '[{"moduleName":"sampleModuleName","revision":"2021-10-03","content":"module sampleModuleName{ sample module content }"}]'
         and: 'response returns an OK http code'
             response.status == HttpStatus.OK.value()
     }
@@ -432,7 +432,7 @@ class NetworkCmProxyControllerSpec extends Specification {
 
     def compositeStateTestObject() {
         new CompositeState(cmHandleState: CmHandleState.ADVISED,
-            lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MISBEHAVING).details("lock misbehaving details").build(),
+            lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
             lastUpdateTime: formattedDateAndTime.toString(),
             dataSyncEnabled: false,
             dataStores: dataStores())
@@ -448,12 +448,12 @@ class NetworkCmProxyControllerSpec extends Specification {
             '"state":',
             '"cmHandleState":"ADVISED"',
             '"reason":"LOCKED_MISBEHAVING"',
-            '"details":"lock misbehaving details"',
+            '"details":"lock details"',
             '"lastUpdateTime":"2022-12-31T20:30:40.000+0000"',
             '"dataSyncEnabled":false',
             '"dataSyncState":',
             '"operational":',
-            '"state":"NONE_REQUESTED"',
+            '"syncState":"NONE_REQUESTED"',
             '"lastSyncTime":"2022-12-31T20:30:40.000+0000"',
             '"running":null'
         ]