2 * Copyright © 2017-2018 AT&T Intellectual Property.
3 * Modifications Copyright © 2019 Bell Canada.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api
20 import org.junit.Ignore
22 import org.junit.runner.RunWith
23 import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput
24 import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService
25 import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
26 import org.springframework.beans.factory.annotation.Autowired
27 import org.springframework.boot.autoconfigure.EnableAutoConfiguration
28 import org.springframework.context.annotation.ComponentScan
29 import org.springframework.test.annotation.DirtiesContext
30 import org.springframework.test.context.TestPropertySource
31 import org.springframework.test.context.junit4.SpringRunner
32 import java.nio.file.Paths
33 import kotlin.test.assertTrue
36 @RunWith(SpringRunner::class)
38 @EnableAutoConfiguration
39 @ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"])
40 @TestPropertySource(locations = ["classpath:application-test.properties"])
41 class ExecutionServiceHandlerTest {
44 lateinit var executionServiceHandler: ExecutionServiceHandler
47 lateinit var blueprintCatalog: BluePrintCatalogService
51 val file = Paths.get("./src/test/resources/test-cba.zip").toFile()
52 assertTrue(file.exists(), "couldnt get file ${file.absolutePath}")
54 blueprintCatalog.saveToDatabase(file)
56 val executionServiceInput = JacksonUtils.readValueFromClassPathFile("execution-input/default-input.json", ExecutionServiceInput::class.java)!!
58 executionServiceHandler.process(executionServiceInput)