Investigate and update Spock version
[cps.git] / cps-rest / src / test / groovy / org / onap / cps / rest / controller / QueryRestControllerSpec.groovy
index 907528a..e42c75c 100644 (file)
 
 package org.onap.cps.rest.controller
 
+import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
+import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+
 import com.google.gson.Gson
 import org.modelmapper.ModelMapper
 import org.onap.cps.api.CpsAdminService
@@ -33,14 +37,10 @@ import org.springframework.beans.factory.annotation.Value
 import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
 import org.springframework.http.HttpStatus
 import org.springframework.test.web.servlet.MockMvc
-import spock.lang.Unroll
-
-import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
-import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+import spock.lang.Specification
 
 @WebMvcTest
-class QueryRestControllerSpec extends RestControllerSpecification {
+class QueryRestControllerSpec extends Specification {
 
     @SpringBean
     CpsDataService mockCpsDataService = Mock()
@@ -63,7 +63,6 @@ class QueryRestControllerSpec extends RestControllerSpecification {
     @Value('${rest.api.cps-base-path}')
     def basePath
 
-    @Unroll
     def 'Query data node by cps path for the given dataspace and anchor with #scenario.'() {
         given: 'service method returns a list containing a data node'
             def dataNode = new DataNodeBuilder().withXpath('/xpath').build()
@@ -77,7 +76,6 @@ class QueryRestControllerSpec extends RestControllerSpecification {
             def response =
                     mvc.perform(
                             get(dataNodeEndpoint)
-                                    .header("Authorization", getAuthorizationHeader())
                                     .param('cps-path', cpsPath)
                                     .param('include-descendants', includeDescendantsOption))
                             .andReturn().response