aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2020-09-22 12:16:46 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2020-09-22 13:49:05 -0400
commit1072867dfac0df993cbd3e44bcc11a5cac7465fd (patch)
tree4a821659cf3b50cf946cbb535d528be8508e9fff /ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test
parentd97021cd756d63402545fdc2e14ac7611c3da118 (diff)
Enabling Code Formatter
Code Formatter was turned off due to java 11 migation Issue-ID: CCSDK-2852 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: I3d02ed3cc7a93d7551fe25356512cfe8db1517d8
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test')
-rw-r--r--ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt57
1 files changed, 31 insertions, 26 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt
index 3fb7f6802..e6043caae 100644
--- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt
+++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/kotlin/org/ccsdk/cds/blueprintprocessor/dmaap/TestDmaapEventPublisher.kt
@@ -50,17 +50,21 @@ import kotlin.test.assertNotNull
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ContextConfiguration(
- classes = [BluePrintDmaapLibConfiguration::class, TestController::class,
- BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class]
+ classes = [
+ BluePrintDmaapLibConfiguration::class, TestController::class,
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class
+ ]
)
@TestPropertySource(
- properties = ["server.port=9111",
+ properties = [
+ "server.port=9111",
"blueprintsprocessor.dmaapclient.aai.topic=cds_aai",
"blueprintsprocessor.dmaapclient.aai.type=HTTPNOAUTH",
"blueprintsprocessor.dmaapclient.aai.host=127.0.0.1:9111",
"blueprintsprocessor.dmaapclient.multi.topic=cds_multi1,cds_multi2",
"blueprintsprocessor.dmaapclient.multi.type=HTTPNOAUTH",
- "blueprintsprocessor.dmaapclient.multi.host=127.0.0.1:9111"]
+ "blueprintsprocessor.dmaapclient.multi.host=127.0.0.1:9111"
+ ]
)
class TestDmaapEventPublisher {
@@ -77,8 +81,8 @@ class TestDmaapEventPublisher {
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
@@ -95,8 +99,8 @@ class TestDmaapEventPublisher {
fun testEventPropertiesWithSingleMsg() {
val dmaapClient = dmaapService.blueprintDmaapClientService("aai")
val str: String = "{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
dmaapClient.sendMessage(str)
val msgs = dmaapClient.close(2)
assertEquals(msgs!!.size, 1)
@@ -114,8 +118,8 @@ class TestDmaapEventPublisher {
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
@@ -132,10 +136,10 @@ class TestDmaapEventPublisher {
@Test
fun testMultiTopicPropertiesWithJsonInput() {
val jsonString = "{\n" +
- " \"topic\" : \"cds_json1,cds_json2\",\n" +
- " \"type\" : \"HTTPNOAUTH\",\n" +
- " \"host\" : \"127.0.0.1:9111\"\n" +
- "}"
+ " \"topic\" : \"cds_json1,cds_json2\",\n" +
+ " \"type\" : \"HTTPNOAUTH\",\n" +
+ " \"host\" : \"127.0.0.1:9111\"\n" +
+ "}"
val mapper = ObjectMapper()
val node = mapper.readTree(jsonString)
val strList = mutableListOf<String>()
@@ -143,8 +147,8 @@ class TestDmaapEventPublisher {
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
@@ -165,13 +169,13 @@ class TestDmaapEventPublisher {
strList.add(
"{\n" +
- " \"a\" : \"hello\"\n" +
- "}"
+ " \"a\" : \"hello\"\n" +
+ "}"
)
strList.add(
"{\n" +
- " \"a\" : \"second\"\n" +
- "}"
+ " \"a\" : \"second\"\n" +
+ "}"
)
dmaapClient.sendMessage(strList)
val msgs = dmaapClient.close(2)
@@ -190,8 +194,9 @@ class TestDmaapEventPublisher {
)
assertNotNull(properties, "failed to create property bean")
assertNotNull(
- properties.host, "failed to get url property" +
- " in property bean"
+ properties.host,
+ "failed to get url property" +
+ " in property bean"
)
}
@@ -221,11 +226,11 @@ open class TestController {
*/
@PostMapping(path = ["/{topic}"])
fun postTopic(@PathVariable(value = "topic") topic: String):
- ResponseEntity<Any> {
- var a = "{\n" +
+ ResponseEntity<Any> {
+ var a = "{\n" +
" \"message\" : \"The message is published into $topic " +
"topic\"\n" +
"}"
- return ResponseEntity(a, HttpStatus.OK)
- }
+ return ResponseEntity(a, HttpStatus.OK)
+ }
}