assertNotNull(stanza);
assertEquals(expectedFrom, stanza.getFrom());
assertEquals(expectedTo, stanza.getTo());
assertEquals(expectedType, stanza.getAttributeValue("type"));
XMLElement xElm = stanza.getFirstInnerElement();
assertEquals(NamespaceURIs.XEP0045_MUC_USER, xElm.getNamespaceURI());
Iterator<XMLElement> innerElements = xElm.getInnerElements().iterator();
for(Item item : expectedItems) {
XMLElement itemElm = innerElements.next();
assertEquals("item", itemElm.getName());
assertEquals(item.getJid().getFullQualifiedName(), itemElm.getAttributeValue("jid"));
assertEquals(item.getNick(), itemElm.getAttributeValue("nick"));
assertEquals(item.getAffiliation().toString(), itemElm.getAttributeValue("affiliation"));
assertEquals(item.getRole().toString(), itemElm.getAttributeValue("role"));
}
if(expectedStatuses != null) {
for(StatusCode status : expectedStatuses) {
XMLElement statusElm = innerElements.next();
assertEquals("status", statusElm.getName());
assertEquals(status.code(), Integer.parseInt(statusElm.getAttributeValue("code")));
}
}
}