1 package org.onap.cps.api.impl
3 import org.onap.cps.spi.DataPersistencyService
4 import spock.lang.Specification;
7 class CpServiceImplSpec extends Specification {
9 def dataPersistencyService = Mock(DataPersistencyService)
10 def objectUnderTest = new CpServiceImpl()
13 // Insert mocked dependencies
14 objectUnderTest.dataPersistencyService = dataPersistencyService;
17 def 'Storing a json object'() {
18 given: 'that the data persistency service returns an id of 123'
19 dataPersistencyService.storeJsonStructure(_) >> 123
21 when: 'a json structure is stored using the data persistency service'
22 def result = objectUnderTest.storeJsonStructure('')
24 then: ' the same id is returned'