File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/AndroidClient/client/src/test/java/net/servicestack/client Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -363,8 +363,13 @@ public void test_Does_reconnect_on_lost_connection() throws Exception {
363363 public void test_Does_send_message_to_Handler() throws Exception {
364364
365365 List<ChatMessage> chatMsgs = new ArrayList<>();
366+ List<String> paintMsgs = new ArrayList<>();
366367
367368 try(ServerEventsClient client1 = createServerEventsClient("http://chat.servicestack.net")
369+ .registerHandler("paint", (client, e) -> {
370+ String color = JsonUtils.fromJson(e.getJson(), String.class);
371+ paintMsgs.add(color);
372+ })
368373 .registerHandler("chat", (client, e) -> {
369374 ChatMessage chatMsg = JsonUtils.fromJson(e.getJson(), ChatMessage.class);
370375 chatMsgs.add(chatMsg);
@@ -389,6 +394,14 @@ public void test_Does_send_message_to_Handler() throws Exception {
389394
390395 chatMsg = Func.last(chatMsgs);
391396 assertEquals("msg2", chatMsg.getMessage());
397+
398+ postRaw(client1, "cmd.paint$#town", "red");
399+
400+ while (paintMsgs.size() < 1){
401+ Thread.sleep(100);
402+ }
403+
404+ assertEquals("red", paintMsgs.get(0));
392405 }
393406 }
394407
You can’t perform that action at this time.
0 commit comments