aboutsummaryrefslogtreecommitdiffstats
path: root/cps-rest/src/test/groovy
diff options
context:
space:
mode:
authorJosephKeenan <joseph.keenan@est.tech>2021-08-03 18:24:32 +0100
committerRenu Kumari <renu.kumari@bell.ca>2021-08-10 10:44:24 -0400
commitbe21595d53636e2c9b912bfbe8dfdefb81edc70f (patch)
treec40add4ce147e0ab6da7814384dd42d82e316079 /cps-rest/src/test/groovy
parentdce1d58005d90950e00b22078d82559748dcb255 (diff)
Upgrade Swager Codegen-maven-plugin
- Removed swagger annotations dependency as latest plugin generates code using v3 annotations. - updated the method signature as per the new generated code - removed unnecessary mock springbeans from the WebMvcTest Issue-ID: CPS-205 Change-Id: Ie7911d7389dca587bde945d913f458de46027e0f Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
Diffstat (limited to 'cps-rest/src/test/groovy')
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy8
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy14
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy14
3 files changed, 3 insertions, 33 deletions
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
index 2f97a31dc0..84da2db5d7 100755
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
@@ -49,7 +49,7 @@ import org.springframework.util.LinkedMultiValueMap
import org.springframework.util.MultiValueMap
import spock.lang.Specification
-@WebMvcTest
+@WebMvcTest(AdminRestController)
class AdminRestControllerSpec extends Specification {
@SpringBean
@@ -59,12 +59,6 @@ class AdminRestControllerSpec extends Specification {
CpsAdminService mockCpsAdminService = Mock()
@SpringBean
- CpsDataService mockCpsDataService = Mock()
-
- @SpringBean
- CpsQueryService mockCpsQueryService = Mock()
-
- @SpringBean
ModelMapper modelMapper = Spy()
@Autowired
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
index ec31c7fe03..8675f42a51 100755
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy
@@ -46,24 +46,12 @@ import org.springframework.test.web.servlet.MockMvc
import spock.lang.Shared
import spock.lang.Specification
-@WebMvcTest
+@WebMvcTest(DataRestController)
class DataRestControllerSpec extends Specification {
@SpringBean
CpsDataService mockCpsDataService = Mock()
- @SpringBean
- CpsModuleService mockCpsModuleService = Mock()
-
- @SpringBean
- CpsAdminService mockCpsAdminService = Mock()
-
- @SpringBean
- CpsQueryService mockCpsQueryService = Mock()
-
- @SpringBean
- ModelMapper modelMapper = Mock()
-
@Autowired
MockMvc mvc
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
index 6b6bdeeeb5..d43e02b316 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/QueryRestControllerSpec.groovy
@@ -41,24 +41,12 @@ import org.springframework.http.HttpStatus
import org.springframework.test.web.servlet.MockMvc
import spock.lang.Specification
-@WebMvcTest
+@WebMvcTest(QueryRestController)
class QueryRestControllerSpec extends Specification {
@SpringBean
- CpsDataService mockCpsDataService = Mock()
-
- @SpringBean
- CpsModuleService mockCpsModuleService = Mock()
-
- @SpringBean
- CpsAdminService mockCpsAdminService = Mock()
-
- @SpringBean
CpsQueryService mockCpsQueryService = Mock()
- @SpringBean
- ModelMapper modelMapper = Mock()
-
@Autowired
MockMvc mvc