Created
January 19, 2024 19:17
-
-
Save jt70/d19debaa081d93db8a1aa9792fc17a7f to your computer and use it in GitHub Desktop.
vertx-eventbus-bridge-clients test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| public void testSubscribeString(final TestContext ctx) throws Exception { | |
| final Async async = ctx.async(); | |
| final EventBusClient client = client(ctx); | |
| client.consumer("client_addr", new Handler<Message<Object>>() { | |
| @Override | |
| public void handle(Message<Object> event) { | |
| ctx.assertEquals("hello", event.body()); | |
| async.complete(); | |
| client.close(); | |
| } | |
| }); | |
| vertx.eventBus().consumer("send_to_client", msg -> { | |
| vertx.eventBus().send("client_addr", "hello"); | |
| }); | |
| client.send("send_to_client", new HashMap<>()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment