Skip to content

Commit

Permalink
StreamBridge test cleanup
Browse files Browse the repository at this point in the history
 - Fix a race condtion that causes a CI failure
  • Loading branch information
sobychacko committed Sep 28, 2023
1 parent a74b3d5 commit db5b717
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,22 +575,20 @@ void testBridgeFunctionsWitthPartitionInformation() {
}

@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<byte[]> 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");
}
Expand Down

0 comments on commit db5b717

Please sign in to comment.