package org.onap.cps.api.impl
import org.onap.cps.TestUtils
-import org.onap.cps.api.CpsAdminService
-import org.onap.cps.spi.CpsDataPersistenceService
import org.onap.cps.spi.CpsModulePersistenceService
import org.onap.cps.spi.exceptions.ModelValidationException
import org.onap.cps.spi.model.ModuleReference
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.cache.CacheManager
+import org.springframework.cache.annotation.EnableCaching
import org.springframework.cache.caffeine.CaffeineCacheManager
-import org.springframework.context.annotation.ComponentScan
import org.springframework.test.context.ContextConfiguration
import spock.lang.Specification
import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED
@SpringBootTest
-@ComponentScan("org.onap.cps")
-@ContextConfiguration(classes = CpsModuleServiceImplSpec.class)
+@EnableCaching
+@ContextConfiguration(classes = [YangTextSchemaSourceSetCache.class, CpsModuleServiceImpl.class])
class CpsModuleServiceImplSpec extends Specification {
+
@SpringBean
CpsModulePersistenceService mockModuleStoreService = Mock()
+
@SpringBean
- CpsAdminService mockCpsAdminService = Mock()
- @SpringBean
- CpsDataPersistenceService mockDataPersistenceService = Mock()
+ CacheManager cacheManager = new CaffeineCacheManager("yangSchema")
+
@Autowired
- CpsModuleServiceImpl objectUnderTest = new CpsModuleServiceImpl()
- @SpringBean
- CacheManager cacheManager = new CaffeineCacheManager("yangSchema");
+ CpsModuleServiceImpl objectUnderTest
def 'Create schema set'() {
given: 'Valid yang resource as name-to-content map'