diff --git a/Mage.Client/src/main/java/mage/client/util/IgnoreList.java b/Mage.Client/src/main/java/mage/client/util/IgnoreList.java index 0144e2de23f..1e8483f1e08 100644 --- a/Mage.Client/src/main/java/mage/client/util/IgnoreList.java +++ b/Mage.Client/src/main/java/mage/client/util/IgnoreList.java @@ -34,8 +34,8 @@ public final class IgnoreList { public static String getIgnoreListInfo(String serverAddress) { List list = new ArrayList<>(getIgnoredUsers(serverAddress)); Collections.sort(list); - return "Current ignore list on " + serverAddress + " (" + list.size() + "): " - + String.join(", ", list) + return "Current ignore list on " + serverAddress + " (total: " + list.size() + "): " + + "[" + String.join(", ", list) + "]" + ""; } diff --git a/Mage.Client/src/test/java/mage/client/util/IgnoreListTest.java b/Mage.Client/src/test/java/mage/client/util/IgnoreListTest.java index d8d184fdbf5..73f345cf5d8 100644 --- a/Mage.Client/src/test/java/mage/client/util/IgnoreListTest.java +++ b/Mage.Client/src/test/java/mage/client/util/IgnoreListTest.java @@ -23,16 +23,16 @@ public class IgnoreListTest { @Test public void ignoreListEmpty() throws Exception { - assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx: []")); + assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx (total: 0): []")); } @Test public void ignoreList() throws Exception { final String test = IgnoreList.ignore("test.com.xx", "test"); final String kranken = IgnoreList.ignore("test.com.xx", "kranken"); - assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx: [kranken, test]")); - assertThat(test, is("Added test to your ignore list on test.com.xx")); - assertThat(kranken, is("Added kranken to your ignore list on test.com.xx")); + assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx (total: 2): [kranken, test]")); + assertThat(test, is("Added test to your ignore list on test.com.xx (total: 1)")); + assertThat(kranken, is("Added kranken to your ignore list on test.com.xx (total: 2)")); } @Test @@ -40,7 +40,7 @@ public class IgnoreListTest { assertThat(IgnoreList.userIsIgnored("test.com.xx", "kranken"), is(false)); final String r = IgnoreList.ignore("test.com.xx", "kranken"); assertThat(IgnoreList.userIsIgnored("test.com.xx", "kranken"), is(true)); - assertEquals(r, "Added kranken to your ignore list on test.com.xx"); + assertEquals(r, "Added kranken to your ignore list on test.com.xx (total: 1)"); } @Test @@ -56,19 +56,19 @@ public class IgnoreListTest { public void ignoreDefaultResponse() throws Exception { final String r1 = IgnoreList.ignore("test.com.xx", ""); final String r2 = IgnoreList.ignore("test.com.xx", null); - assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx: []")); + assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx (total: 0): []")); assertEquals(r1, r2); - assertEquals(r2, "Current ignore list on test.com.xx: []"); + assertEquals(r2, "Current ignore list on test.com.xx (total: 0): []"); } @Test public void ignoreMaxSize() throws Exception { - for (int i = 0; i < 50; i++) { + for (int i = 0; i < 100; i++) { IgnoreList.ignore("test.com.xx", "" + i); } final String r = IgnoreList.ignore("test.com.xx", "lul"); - assertEquals(r, "Your ignore list is too big, remove a user to be able to add a new one."); - assertThat(IgnoreList.getIgnoreListInfo("test.com.xx"), is("Current ignore list on test.com.xx: [0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 5, 6, 7, 8, 9]")); + assertEquals(r, "Your ignore list is too big (max 100), remove a user to be able to add a new one."); + assertThat(IgnoreList.getIgnoredUsers("test.com.xx").size(), is(100)); } @Test @@ -78,7 +78,7 @@ public class IgnoreListTest { assertThat(IgnoreList.userIsIgnored("test.com.xx", "kranken"), is(true)); final String r = IgnoreList.unignore("test.com.xx", "kranken"); assertThat(IgnoreList.userIsIgnored("test.com.xx", "kranken"), is(false)); - assertEquals(r, "Removed kranken from your ignore list on test.com.xx"); + assertEquals(r, "Removed kranken from your ignore list on test.com.xx (total: 0)"); }