EntityImpl fromEntity = EntityImpl.parse("userFrom@vysper.org");
EntityImpl toEntity = EntityImpl.parse("userTo@vysper.org");
TestSessionContext sessionContextToEntity_1_prio3 = createSessionForTo(toEntity, 3); // NON-NEGATIVE
TestSessionContext sessionContextToEntity_2_prio0 = createSessionForTo(toEntity, 0); // NON-NEGATIVE
TestSessionContext sessionContextToEntity_3_prio3 = createSessionForTo(toEntity, 3); // NON-NEGATIVE
TestSessionContext sessionContextToEntity_4_prioMinus = createSessionForTo(toEntity, -1); // not receiving, negative
Stanza stanza = StanzaBuilder.createMessageStanza(fromEntity, toEntity, "en", "Hello").build();
try {
stanzaRelay.relay(toEntity, stanza, new IgnoreFailureStrategy());
Stanza recordedStanza_1 = sessionContextToEntity_1_prio3.getNextRecordedResponse(100);
assertNotNull("stanza 1 delivered", recordedStanza_1);
Stanza recordedStanza_2 = sessionContextToEntity_2_prio0.getNextRecordedResponse(100);
assertNotNull("stanza 2 delivered", recordedStanza_2);
Stanza recordedStanza_3 = sessionContextToEntity_3_prio3.getNextRecordedResponse(100);
assertNotNull("stanza 3 delivered", recordedStanza_3);
Stanza recordedStanza_4 = sessionContextToEntity_4_prioMinus.getNextRecordedResponse(100);
assertNull("stanza 4 delivered", recordedStanza_4);
} catch (DeliveryException e) {
throw e;
}