From c711057d80b6b4e16fbbb19747872a20b34b9875 Mon Sep 17 00:00:00 2001 From: hantsy Date: Mon, 29 Apr 2024 17:40:19 +0800 Subject: [PATCH] chore: clean codes --- kafka/src/main/java/com/example/MessageHandler.java | 2 +- kafka/src/test/java/com/example/InMemoryProfile.java | 2 +- .../src/test/java/com/example/MessageHandlerTest.java | 2 +- pulsar/src/main/java/com/example/MessageHandler.java | 2 +- pulsar/src/test/java/com/example/InMemoryProfile.java | 2 +- .../src/test/java/com/example/MessageHandlerTest.java | 11 ++++++----- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kafka/src/main/java/com/example/MessageHandler.java b/kafka/src/main/java/com/example/MessageHandler.java index 74b6adaa7..8bab314b2 100644 --- a/kafka/src/main/java/com/example/MessageHandler.java +++ b/kafka/src/main/java/com/example/MessageHandler.java @@ -23,7 +23,7 @@ public void send(String message) { } @Incoming("messages") - @Outgoing("data-stream") + @Outgoing("data-result") @Broadcast Message receive(String message) { log.info("received: {}", message); diff --git a/kafka/src/test/java/com/example/InMemoryProfile.java b/kafka/src/test/java/com/example/InMemoryProfile.java index 7bcb7e648..f7958821e 100644 --- a/kafka/src/test/java/com/example/InMemoryProfile.java +++ b/kafka/src/test/java/com/example/InMemoryProfile.java @@ -14,7 +14,7 @@ public Map getConfigOverrides() { "quarkus.kafka.devservices.enabled", "false", "mp.messaging.outgoing.send.connector","smallrye-in-memory", "mp.messaging.incoming.messages.connector","smallrye-in-memory", - "mp.messaging.outgoing.data-stream.connector","smallrye-in-memory" + "mp.messaging.outgoing.data-result.connector","smallrye-in-memory" ); } diff --git a/kafka/src/test/java/com/example/MessageHandlerTest.java b/kafka/src/test/java/com/example/MessageHandlerTest.java index 9b1ce54a2..8023c533f 100644 --- a/kafka/src/test/java/com/example/MessageHandlerTest.java +++ b/kafka/src/test/java/com/example/MessageHandlerTest.java @@ -34,7 +34,7 @@ void setUp() { void receive() { InMemorySource messages = connector.source("messages"); InMemorySink sink = connector.sink("send"); - InMemorySink dataStream = connector.sink("data-stream"); + InMemorySink dataStream = connector.sink("data-result"); handler.send("hello"); await().atMost(Duration.ofMillis(1000)).untilAsserted(() -> diff --git a/pulsar/src/main/java/com/example/MessageHandler.java b/pulsar/src/main/java/com/example/MessageHandler.java index 74b6adaa7..8bab314b2 100644 --- a/pulsar/src/main/java/com/example/MessageHandler.java +++ b/pulsar/src/main/java/com/example/MessageHandler.java @@ -23,7 +23,7 @@ public void send(String message) { } @Incoming("messages") - @Outgoing("data-stream") + @Outgoing("data-result") @Broadcast Message receive(String message) { log.info("received: {}", message); diff --git a/pulsar/src/test/java/com/example/InMemoryProfile.java b/pulsar/src/test/java/com/example/InMemoryProfile.java index 60ca4b56b..80fd43ea3 100644 --- a/pulsar/src/test/java/com/example/InMemoryProfile.java +++ b/pulsar/src/test/java/com/example/InMemoryProfile.java @@ -14,7 +14,7 @@ public Map getConfigOverrides() { "quarkus.pulsar.devservices.enabled", "false", "mp.messaging.outgoing.send.connector","smallrye-in-memory", "mp.messaging.incoming.messages.connector","smallrye-in-memory", - "mp.messaging.outgoing.data-stream.connector","smallrye-in-memory" + "mp.messaging.outgoing.data-result.connector","smallrye-in-memory" // "pulsar.client.serviceUrl", "", // "pulsar.admin.serviceUrl", "" ); diff --git a/pulsar/src/test/java/com/example/MessageHandlerTest.java b/pulsar/src/test/java/com/example/MessageHandlerTest.java index 16dfcd763..ea10eaa64 100644 --- a/pulsar/src/test/java/com/example/MessageHandlerTest.java +++ b/pulsar/src/test/java/com/example/MessageHandlerTest.java @@ -35,17 +35,18 @@ class MessageHandlerTest { @BeforeEach void setUp() { final Iterable propertyNames = config.getPropertyNames(); - for (final String propertyName : propertyNames) { - final String propertyValue = config.getValue(propertyName, String.class); - log.debug(propertyName + " = " + propertyValue); - } + log.debug("properties: {}", propertyNames); +// for (final String propertyName : propertyNames) { +// final String propertyValue = config.getValue(propertyName, String.class); +// log.debug(propertyName + " = " + propertyValue); +// } } @Test void receive() { InMemorySource messages = connector.source("messages"); InMemorySink sink = connector.sink("send"); - InMemorySink dataStream = connector.sink("data-stream"); + InMemorySink dataStream = connector.sink("data-result"); handler.send("hello"); await().atMost(Duration.ofMillis(1000)).untilAsserted(() ->