Add graceful shutdown for Session Manager
[cps.git] / cps-ri / src / test / groovy / org / onap / cps / spi / impl / CpsDataPersistenceServiceSpec.groovy
index 52f2309..a96b6af 100644 (file)
@@ -127,6 +127,13 @@ class CpsDataPersistenceServiceSpec extends Specification {
         when: 'close session method is called with session ID as parameter'
             objectUnderTest.closeSession(someSessionId)
         then: 'the session manager method to close session is invoked with parameter'
-            1 * mockSessionManager.closeSession(someSessionId)
+            1 * mockSessionManager.closeSession(someSessionId, mockSessionManager.WITH_COMMIT)
+    }
+
+    def 'Lock anchor.'(){
+        when: 'lock anchor method is called with anchor entity details'
+            objectUnderTest.lockAnchor('mySessionId', 'myDataspaceName', 'myAnchorName', 123L)
+        then: 'the session manager method to lock anchor is invoked with same parameters'
+            1 * mockSessionManager.lockAnchor('mySessionId', 'myDataspaceName', 'myAnchorName', 123L)
     }
 }
\ No newline at end of file