FluxMessageChannel.send: no subscribers assertion
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.integration.channel.reactive;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.junit.Assert.assertSame;
|
||||
@@ -259,4 +260,16 @@ public class ReactiveStreamsConsumerTests {
|
||||
assertThat(result, Matchers.<Message<?>>contains(testMessage, testMessage2, testMessage2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFluxMessageChannelSendWithoutSubscription() {
|
||||
try {
|
||||
new FluxMessageChannel().send(new GenericMessage<>("foo"));
|
||||
}
|
||||
catch (Exception e) {
|
||||
assertThat(e, instanceOf(MessageDeliveryException.class));
|
||||
assertThat(e.getCause(), instanceOf(IllegalStateException.class));
|
||||
assertThat(e.getMessage(), containsString("doesn't have subscribers to accept messages"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user