b195fe0fe28e330472d7d6f6053954d19bc999ed
[ccsdk/cds.git] /
1 /*
2  *  Copyright © 2018 IBM.
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16
17 package org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.executor
18
19 import org.junit.Test
20 import org.junit.runner.RunWith
21 import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintProperties
22 import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfiguration
23 import org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor.BlueprintJythonService
24 import org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor.PythonExecutorProperty
25 import org.onap.ccsdk.apps.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
26 import org.springframework.beans.factory.annotation.Autowired
27 import org.springframework.test.context.ContextConfiguration
28 import org.springframework.test.context.TestPropertySource
29 import org.springframework.test.context.junit4.SpringRunner
30 import kotlin.test.assertNotNull
31
32
33 @RunWith(SpringRunner::class)
34 @ContextConfiguration(classes = [RestconfExecutorConfiguration::class, ComponentRestconfExecutor::class,
35     BlueprintJythonService::class, PythonExecutorProperty::class, BluePrintRestLibPropertyService::class,
36     BlueprintPropertyConfiguration::class,BluePrintProperties::class])
37 @TestPropertySource(properties =
38 ["server.port=9111",
39     "blueprintsprocessor.restconfEnabled=true",
40     "blueprintsprocessor.restclient.odlPrimary.type=basic-auth",
41     "blueprintsprocessor.restclient.odlPrimary.url=http://127.0.0.1:9111",
42     "blueprintsprocessor.restclient.odlPrimary.userId=sampleuser",
43     "blueprintsprocessor.restclient.odlPrimary.token=sampletoken"])
44 class ComponentRestconfExecutorTest {
45
46     @Autowired
47     lateinit var componentRestconfExecutor: ComponentRestconfExecutor
48
49     @Test
50     fun `test Restconf Component Instance`() {
51
52         assertNotNull(componentRestconfExecutor, "failed to get ComponentRestconfExecutor instance")
53     }
54
55
56 }