summaryrefslogtreecommitdiffstats
path: root/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy19
1 files changed, 8 insertions, 11 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
index d20149bc4..0af0334d5 100644
--- a/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/api/impl/CpsModuleServiceImplSpec.groovy
@@ -21,8 +21,6 @@
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
@@ -30,8 +28,8 @@ import org.spockframework.spring.SpringBean
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
@@ -39,19 +37,18 @@ import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_ALLOWED
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'