aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
diff options
context:
space:
mode:
authoremaclee <lee.anjella.macabuhay@est.tech>2022-03-23 11:02:03 +0000
committerLee Anjella Macabuhay <lee.anjella.macabuhay@est.tech>2022-03-25 16:13:01 +0000
commitc9275522f95f6cd94f28286f5e86f86dd451a19b (patch)
tree58c970ae97fc5d9b9baa935696aeb7ee165644ca /cps-service/src/test
parent81f91b6558e9f385c646005c653937ffe819ad0d (diff)
Add Start and Stop sessions on JAVA API
Issue-ID: CPS-899 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Idbeb922790824b1ca601d6d4798df45efa57d685
Diffstat (limited to 'cps-service/src/test')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy16
1 files changed, 16 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 785788be90..eb06199d1b 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
@@ -254,4 +254,20 @@ class CpsDataServiceImplSpec extends Specification {
def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourceNameToContent).getSchemaContext()
mockYangTextSchemaSourceSet.getSchemaContext() >> schemaContext
}
+
+ def 'start session'() {
+ when: 'start session method is called'
+ objectUnderTest.startSession()
+ then: 'the persistence service method to start session is invoked'
+ 1 * mockCpsDataPersistenceService.startSession()
+ }
+
+ def 'close session'(){
+ given: 'session Id from calling the start session method'
+ def sessionId = objectUnderTest.startSession()
+ when: 'close session method is called'
+ objectUnderTest.closeSession(sessionId)
+ then: 'the persistence service method to close session is invoked'
+ 1 * mockCpsDataPersistenceService.closeSession(sessionId)
+ }
}