From 341db21b2ac0a14a1ed2b8bf7930914dda054bfe Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Fri, 22 Nov 2019 18:06:08 -0500 Subject: Formatting Code base with ktlint No Business logic change, just the code format. Competible with IntelliJ: https://github.com/pinterest/ktlint#option-3 To format run: mvn process-sources -P format Issue-ID: CCSDK-1947 Signed-off-by: Singal, Kapil (ks220y) Change-Id: Ic9e9209fb7023d77f434693ad5a01229f8d09331 --- .../api/ResourceConfigSnapshotControllerTest.kt | 48 +++++++++++----------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin') diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt index 89f62812e..34c7a7c7c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt @@ -35,8 +35,10 @@ import org.springframework.web.reactive.function.BodyInserters @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 { @@ -68,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 { println(it) } + .post() + .uri("/api/v1/configs/$resourceType/$resourceId/running") + .body(BodyInserters.fromObject(snapshotData)) + .exchange() + .expectStatus().is2xxSuccessful + .expectBody() + .jsonPath("$.createdDate") + .value { println(it) } webTestClient - .post() - .uri("/api/v1/configs/$resourceType/$resourceId/running") - .body(BodyInserters.fromObject(snapshotData)) - .exchange() - .expectStatus().is2xxSuccessful - .expectBody() - .jsonPath("$.createdDate") - .value { println(it)} + .post() + .uri("/api/v1/configs/$resourceType/$resourceId/running") + .body(BodyInserters.fromObject(snapshotData)) + .exchange() + .expectStatus().is2xxSuccessful + .expectBody() + .jsonPath("$.createdDate") + .value { println(it) } } } @@ -93,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") } } @@ -122,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 } } @@ -140,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") @@ -150,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()) { -- cgit 1.2.3-korg