From db5b717fc4c3df7d09b624f843272b2280bb825f Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 28 Sep 2023 12:47:35 -0400 Subject: [PATCH] StreamBridge test cleanup - Fix a race condtion that causes a CI failure --- .../cloud/stream/function/StreamBridgeTests.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/StreamBridgeTests.java b/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/StreamBridgeTests.java index 57f1c8837..2c8a6fb31 100644 --- a/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/StreamBridgeTests.java +++ b/core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/StreamBridgeTests.java @@ -575,22 +575,20 @@ public class StreamBridgeTests { } @Test - void testSendingMessageToOutputOfExistingSupplier() throws Exception { + void testSendingMessageToOutputOfExistingSupplier() { try (ConfigurableApplicationContext context = new SpringApplicationBuilder(TestChannelBinderConfiguration .getCompleteConfiguration(TestConfiguration.class)) - .web(WebApplicationType.NONE).run("--spring.cloud.stream.output-bindings=supplier;foo", - "--spring.jmx.enabled=false")) { + .web(WebApplicationType.NONE).run("--spring.cloud.stream.output-bindings=supplier;foo")) { StreamBridge bridge = context.getBean(StreamBridge.class); - bridge.send("supplier-out-0", "blah"); bridge.send("foo-out-0", "b"); - OutputDestination outputDestination = context.getBean(OutputDestination.class); Message message = outputDestination.receive(100, "foo-out-0"); assertThat(new String(message.getPayload())).isEqualTo("b"); message = outputDestination.receive(100, "supplier-out-0"); assertThat(new String(message.getPayload())).isEqualTo("hello"); + bridge.send("supplier-out-0", "blah"); message = outputDestination.receive(100, "supplier-out-0"); assertThat(new String(message.getPayload())).isEqualTo("blah"); }