Merge "Enable log level management via actuator, /cps/api path to use for REST contro...
authorToine Siebelink <toine.siebelink@est.tech>
Fri, 22 Jan 2021 15:32:19 +0000 (15:32 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 22 Jan 2021 15:32:19 +0000 (15:32 +0000)
1  2 
cps-rest/src/main/resources/application.yml
cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy

@@@ -176,22 -142,9 +180,22 @@@ class AdminRestControllerSpec extends S
          return new MockMultipartFile("file", filename, "text/plain", content.getBytes())
      }
  
 +    def createZipMultipartFileFromResource(resourcePath) {
 +        return new MockMultipartFile("file", "test.zip", "application/zip",
 +                getClass().getResource(resourcePath).getBytes())
 +    }
 +
 +    def createMultipartFileForIOException(extension) {
 +        def multipartFile = Mock(MockMultipartFile)
 +        multipartFile.getOriginalFilename() >> "TEST." + extension
 +        multipartFile.getBytes() >> { throw new IOException() }
 +        multipartFile.getInputStream() >> { throw new IOException() }
 +        return multipartFile
 +    }
 +
      def performCreateSchemaSetRequest(multipartFile) {
          return mvc.perform(
-                 multipart(schemaSetsEndpoint)
+                 multipart("$basePath$schemaSetsEndpoint")
                          .file(multipartFile)
                          .param('schema-set-name', 'test-schema-set')
          ).andReturn().response