cd02b65dc30654dde0c715054d5bacc7a5ca9908
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2019-2020 Orange.
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.cds.blueprintsprocessor.healthapi
18
19
20 import org.junit.Test
21 import org.junit.runner.RunWith
22 import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration
23 import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService
24 import org.springframework.beans.factory.annotation.Autowired
25 import org.springframework.boot.autoconfigure.security.SecurityProperties
26 import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
27 import org.springframework.context.annotation.ComponentScan
28 import org.springframework.test.context.ContextConfiguration
29 import org.springframework.test.context.TestPropertySource
30 import org.springframework.test.context.junit4.SpringRunner
31 import org.springframework.test.web.reactive.server.WebTestClient
32
33
34 @RunWith(SpringRunner::class)
35 @WebFluxTest
36 @ContextConfiguration(classes = [BluePrintCoreConfiguration::class,
37     BluePrintCatalogService::class, SecurityProperties::class])
38 @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
39 @TestPropertySource(locations = ["classpath:application-test.properties"])
40 class HealthCheckApplicationTests {
41
42
43     @Autowired
44     lateinit var webTestClient: WebTestClient
45
46     @Test
47     fun testHealthApiUp() {
48         val result = webTestClient.get().uri("/api/v1/health")
49                 .exchange()
50                 .expectStatus().is2xxSuccessful
51         println(result)
52     }
53
54
55 }