summaryrefslogtreecommitdiffstats
path: root/cps-service/src/test/groovy/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/test/groovy/org/onap')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy17
1 files changed, 17 insertions, 0 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
index faeba8d51..8b9d54529 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy
@@ -430,4 +430,21 @@ class CpsDataServiceImplSpec extends Specification {
then: 'the persistence service method to close session is invoked'
1 * mockCpsDataPersistenceService.closeSession(sessionId)
}
+
+ def 'lock anchor with no timeout parameter'(){
+ when: 'lock anchor method with no timeout parameter with details of anchor entity to lock'
+ objectUnderTest.lockAnchor('some-sessionId', 'some-dataspaceName', 'some-anchorName')
+ then: 'the persistence service method to lock anchor is invoked with default timeout'
+ 1 * mockCpsDataPersistenceService.lockAnchor('some-sessionId', 'some-dataspaceName',
+ 'some-anchorName', 300L)
+ }
+
+ def 'lock anchor with timeout parameter'(){
+ when: 'lock anchor method with timeout parameter is called with details of anchor entity to lock'
+ objectUnderTest.lockAnchor('some-sessionId', 'some-dataspaceName',
+ 'some-anchorName', 250L)
+ then: 'the persistence service method to lock anchor is invoked with the given timeout'
+ 1 * mockCpsDataPersistenceService.lockAnchor('some-sessionId', 'some-dataspaceName',
+ 'some-anchorName', 250L)
+ }
}