From 1f7770b831049ae651e1fec08834bc973498df48 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 23 Dec 2016 23:41:31 +0100 Subject: [PATCH] More detailed logging to RosterIntegrationTest --- .../smack/roster/RosterIntegrationTest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java index 8691bacac..537d00c7e 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java @@ -32,6 +32,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.roster.packet.RosterPacket.ItemType; +import org.jivesoftware.smack.util.StringUtils; import org.jxmpp.jid.BareJid; import org.jxmpp.jid.Jid; @@ -77,7 +78,17 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest { if (!jid.equals(conTwo.getUser().asBareJid())) { continue; } - RosterEntry rosterEntry = rosterOne.getEntry(conTwo.getUser().asBareJid()); + BareJid bareJid = conTwo.getUser().asBareJid(); + RosterEntry rosterEntry = rosterOne.getEntry(bareJid); + if (rosterEntry == null) { + addedAndSubscribed.signalFailure("No roster entry for " + bareJid); + return; + } + String name = rosterEntry.getName(); + if (StringUtils.isNullOrEmpty(name)) { + addedAndSubscribed.signalFailure("Roster entry without name"); + return; + } if (!rosterEntry.getName().equals(conTwosRosterName)) { addedAndSubscribed.signalFailure("Roster name does not match"); return;