Formatting Code base with ktlint
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / inbounds / configs-api / src / test / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / configs / api / ResourceConfigSnapshotControllerTest.kt
index b4c1ad0..34c7a7c 100644 (file)
@@ -32,12 +32,13 @@ import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.SpringRunner
 import org.springframework.test.web.reactive.server.WebTestClient
 import org.springframework.web.reactive.function.BodyInserters
-import java.util.*
 
 @RunWith(SpringRunner::class)
 @WebFluxTest
-@ContextConfiguration(classes = [BluePrintCoreConfiguration::class,
-    BluePrintCatalogService::class, SecurityProperties::class])
+@ContextConfiguration(
+    classes = [BluePrintCoreConfiguration::class,
+        BluePrintCatalogService::class, SecurityProperties::class]
+)
 @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
 @TestPropertySource(locations = ["classpath:application-test.properties"])
 class ResourceConfigSnapshotControllerTest {
@@ -69,24 +70,24 @@ class ResourceConfigSnapshotControllerTest {
         runBlocking {
 
             webTestClient
-                    .post()
-                    .uri("/api/v1/configs/$resourceType/$resourceId/running")
-                    .body(BodyInserters.fromObject(snapshotData))
-                    .exchange()
-                    .expectStatus().is2xxSuccessful
-                    .expectBody()
-                    .jsonPath("$.createdDate")
-                        .value<String> { println(it) }
+                .post()
+                .uri("/api/v1/configs/$resourceType/$resourceId/running")
+                .body(BodyInserters.fromObject(snapshotData))
+                .exchange()
+                .expectStatus().is2xxSuccessful
+                .expectBody()
+                .jsonPath("$.createdDate")
+                .value<String> { println(it) }
 
             webTestClient
-                    .post()
-                    .uri("/api/v1/configs/$resourceType/$resourceId/running")
-                    .body(BodyInserters.fromObject(snapshotData))
-                    .exchange()
-                    .expectStatus().is2xxSuccessful
-                    .expectBody()
-                    .jsonPath("$.createdDate")
-                        .value<String> { println(it)}
+                .post()
+                .uri("/api/v1/configs/$resourceType/$resourceId/running")
+                .body(BodyInserters.fromObject(snapshotData))
+                .exchange()
+                .expectStatus().is2xxSuccessful
+                .expectBody()
+                .jsonPath("$.createdDate")
+                .value<String> { println(it) }
         }
     }
 
@@ -94,7 +95,7 @@ class ResourceConfigSnapshotControllerTest {
     fun `get returns requested JSON content-type`() {
         runBlocking {
             post(resourceType, "22", "RUNNING")
-            get("json", resourceType,"22", "RUNNING")
+            get("json", resourceType, "22", "RUNNING")
         }
     }
 
@@ -123,8 +124,8 @@ class ResourceConfigSnapshotControllerTest {
             val arguments = "resourceId=MISSING&resourceType=PNF&status=TOTALLY_WRONG"
 
             webTestClient.get().uri("/api/v1/configs?$arguments")
-                    .exchange()
-                    .expectStatus().isBadRequest
+                .exchange()
+                .expectStatus().isBadRequest
         }
     }
 
@@ -141,7 +142,7 @@ class ResourceConfigSnapshotControllerTest {
         }
     }
 
-    private fun post( resourceType: String, resourceId: String, status: String) {
+    private fun post(resourceType: String, resourceId: String, status: String) {
         webTestClient
             .post()
             .uri("/api/v1/configs/$resourceType/$resourceId/$status")
@@ -151,7 +152,7 @@ class ResourceConfigSnapshotControllerTest {
             .expectBody()
     }
 
-    private fun get(expectedType : String, resourceType: String, resourceId: String, status: String) {
+    private fun get(expectedType: String, resourceType: String, resourceId: String, status: String) {
         var requestArguments = "resourceId=$resourceId&resourceType=$resourceType&status=$status"
 
         if (expectedType.isNotEmpty()) {
@@ -173,4 +174,4 @@ class ResourceConfigSnapshotControllerTest {
                 .expectBody().equals(snapshotData)
         }
     }
-}
\ No newline at end of file
+}