mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-14 19:49:38 +02:00
Fix UOE being thrown in BlockingCommandManager
the manager must use a copy of the BlockListIQ's JID list, since it may be the empty list which is not modifiable. Also rename the getter methods from getJids() to getBlockedJids().
This commit is contained in:
parent
da58b20b53
commit
1b1e88c4c3
3 changed files with 21 additions and 10 deletions
|
@ -47,13 +47,13 @@ public class GetBlockingListTest {
|
|||
public void checkBlockListIQ() throws Exception {
|
||||
IQ iq = (IQ) PacketParserUtils.parseStanza(blockListIQExample);
|
||||
BlockListIQ blockListIQ = (BlockListIQ) iq;
|
||||
Assert.assertEquals(2, blockListIQ.getJids().size());
|
||||
Assert.assertEquals(JidCreate.from("romeo@montague.net"), blockListIQ.getJids().get(0));
|
||||
Assert.assertEquals(JidCreate.from("iago@shakespeare.lit"), blockListIQ.getJids().get(1));
|
||||
Assert.assertEquals(2, blockListIQ.getBlockedJids().size());
|
||||
Assert.assertEquals(JidCreate.from("romeo@montague.net"), blockListIQ.getBlockedJids().get(0));
|
||||
Assert.assertEquals(JidCreate.from("iago@shakespeare.lit"), blockListIQ.getBlockedJids().get(1));
|
||||
|
||||
IQ iq2 = (IQ) PacketParserUtils.parseStanza(emptyBlockListIQExample);
|
||||
BlockListIQ emptyBlockListIQ = (BlockListIQ) iq2;
|
||||
Assert.assertEquals(0, emptyBlockListIQ.getJids().size());
|
||||
Assert.assertEquals(0, emptyBlockListIQ.getBlockedJids().size());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue