From 7348c7396b095b5b92047a643b6675cfcf91690e Mon Sep 17 00:00:00 2001 From: hantsy Date: Tue, 23 Apr 2024 22:24:45 +0800 Subject: [PATCH] chore: clean codes --- pulsar/src/test/java/com/example/InMemoryProfile.java | 1 + pulsar/src/test/java/com/example/MessageHandlerTest.java | 4 ++-- rabbitmq/src/test/java/com/example/InMemoryProfile.java | 7 ++++--- rabbitmq/src/test/java/com/example/MessageHandlerTest.java | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pulsar/src/test/java/com/example/InMemoryProfile.java b/pulsar/src/test/java/com/example/InMemoryProfile.java index 1940a02ce..60ca4b56b 100644 --- a/pulsar/src/test/java/com/example/InMemoryProfile.java +++ b/pulsar/src/test/java/com/example/InMemoryProfile.java @@ -11,6 +11,7 @@ public InMemoryProfile() { @Override public Map getConfigOverrides() { return Map.of( + "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" diff --git a/pulsar/src/test/java/com/example/MessageHandlerTest.java b/pulsar/src/test/java/com/example/MessageHandlerTest.java index 8af8f554c..12662d6a8 100644 --- a/pulsar/src/test/java/com/example/MessageHandlerTest.java +++ b/pulsar/src/test/java/com/example/MessageHandlerTest.java @@ -46,9 +46,9 @@ void receive() { handler.send("hello"); - assertThat(sink.received().get(0).getPayload()).isEqualTo("hello"); + assertThat(sink.received().getFirst().getPayload()).isEqualTo("hello"); messages.send("hello-123"); - assertThat(dataStream.received().get(0).getPayload().body()).isEqualTo("hello-123"); + assertThat(dataStream.received().getFirst().getPayload().body()).isEqualTo("hello-123"); } } \ No newline at end of file diff --git a/rabbitmq/src/test/java/com/example/InMemoryProfile.java b/rabbitmq/src/test/java/com/example/InMemoryProfile.java index 2bcf416eb..0f02f254f 100644 --- a/rabbitmq/src/test/java/com/example/InMemoryProfile.java +++ b/rabbitmq/src/test/java/com/example/InMemoryProfile.java @@ -11,9 +11,10 @@ public InMemoryProfile() { @Override public Map getConfigOverrides() { return Map.of( - "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" + "quarkus.rabbitmq.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" ); } diff --git a/rabbitmq/src/test/java/com/example/MessageHandlerTest.java b/rabbitmq/src/test/java/com/example/MessageHandlerTest.java index e1562aa3c..dd3b6f5f6 100644 --- a/rabbitmq/src/test/java/com/example/MessageHandlerTest.java +++ b/rabbitmq/src/test/java/com/example/MessageHandlerTest.java @@ -35,9 +35,9 @@ void receive() { handler.send("hello"); - assertThat(sink.received().get(0).getPayload()).isEqualTo("hello"); + assertThat(sink.received().getFirst().getPayload()).isEqualTo("hello"); messages.send("hello-123"); - assertThat(dataStream.received().get(0).getPayload().body()).isEqualTo("hello-123"); + assertThat(dataStream.received().getFirst().getPayload().body()).isEqualTo("hello-123"); } } \ No newline at end of file