From 1e5c0403d3339c40950106737ef17727d786f6d4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 30 Jan 2018 13:33:57 +0300 Subject: xmpp: fix description of subscribeMessage command --- juick-xmpp/src/main/java/com/juick/components/JuickBot.java | 4 ++-- juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/juick-xmpp/src/main/java/com/juick/components/JuickBot.java b/juick-xmpp/src/main/java/com/juick/components/JuickBot.java index 2884fdd4..9855f958 100644 --- a/juick-xmpp/src/main/java/com/juick/components/JuickBot.java +++ b/juick-xmpp/src/main/java/com/juick/components/JuickBot.java @@ -563,8 +563,8 @@ public class JuickBot implements StanzaListener, AutoCloseable { } return "Error"; } - @UserCommand(pattern = "^(s|u)\\s+#(\\d+)$", help = "S #1234 - subscribe to comments", - patternFlags = Pattern.CASE_INSENSITIVE) + @UserCommand(pattern = "^(s|u)\\s+#(\\d+)$", help = "S #1234 - subscribe to comments" + + "\nU #1234 - unsubscribe from comments", patternFlags = Pattern.CASE_INSENSITIVE) public String commandSubscribeMessage(User user, Jid from, String... args) { boolean subscribe = args[0].equalsIgnoreCase("s"); int mid = NumberUtils.toInt(args[1], 0); diff --git a/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java b/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java index 784c29b2..7f08602c 100644 --- a/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java +++ b/juick-xmpp/src/test/java/com/juick/xmpp/server/XMPPServerTests.java @@ -95,8 +95,8 @@ public class XMPPServerTests extends AbstractJUnit4SpringContextTests { @Test public void botCommandsTests() throws IllegalAccessException, NoSuchMethodException, InvocationTargetException { assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "PING").get(), is("PONG")); - // tag and user help have two lines, others have 1 - assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "help").get().split("\n").length, is(20)); + // subscription commands have two lines, others have 1 + assertThat(bot.processCommand(new User(), Jid.of("test@localhost"), "help").get().split("\n").length, is(21)); } @Test -- cgit v1.2.3