mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
Test MessageProducer end/close methods with no/null handler
This commit is contained in:
@@ -147,7 +147,11 @@ public class MessageProducerImpl<T> implements MessageProducer<T> {
|
||||
if (creditConsumer != null) {
|
||||
creditConsumer.unregister(handler);
|
||||
} else {
|
||||
vertx.runOnContext(v -> handler.handle(Future.succeededFuture()));
|
||||
vertx.runOnContext(v -> {
|
||||
if (handler != null) {
|
||||
handler.handle(Future.succeededFuture());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1272,6 +1272,26 @@ public class LocalEventBusTest extends EventBusTestBase {
|
||||
await();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCloseSender1() {
|
||||
eb.sender(ADDRESS1).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCloseSender2() {
|
||||
eb.sender(ADDRESS1).close(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClosePublisher1() {
|
||||
eb.publisher(ADDRESS1).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClosePublisher2() {
|
||||
eb.publisher(ADDRESS1).close(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPump() {
|
||||
String str = TestUtils.randomUnicodeString(100);
|
||||
|
||||
Reference in New Issue
Block a user