@Test public void onlyNormalAndChatMessageAreArchived() { UserMessageStanzaBroker tested = buildTested(true, false); Stream.of(MessageStanzaType.values()).filter(messageStanzaType -> messageStanzaType != MessageStanzaType.NORMAL) .filter(messageStanzaType -> messageStanzaType != MessageStanzaType.CHAT).forEach(messageStanzaType -> { MessageStanza stanza = buildMessageStanza(messageStanzaType, null, ALICE_IN_RABBIT_HOLE, "hello world"); tested.writeToSession(stanza); julietArchive.assertEmpty(); romeoArchive.assertEmpty(); macbethArchive.assertEmpty(); }); Stream.of(MessageStanzaType.CHAT, MessageStanzaType.NORMAL).forEach(messageStanzaType -> { julietArchive.clear(); MessageStanza messageStanza = buildMessageStanza(messageStanzaType, null, ALICE_IN_RABBIT_HOLE, "hello world"); tested.writeToSession(messageStanza); julietArchive.assertUniqueArchivedMessageStanza(messageStanza); }); }
@Override public void writeToSession(Stanza stanza) { super.writeToSession(archive(stanza)); }
UserMessageStanzaBroker extends DelegatingStanzaBroker { @Override public void writeToSession(Stanza stanza) { super.writeToSession(archive(stanza)); } }
UserMessageStanzaBroker extends DelegatingStanzaBroker { @Override public void writeToSession(Stanza stanza) { super.writeToSession(archive(stanza)); } UserMessageStanzaBroker(StanzaBroker delegate, ServerRuntimeContext serverRuntimeContext,
            SessionContext sessionContext, boolean isOutbound, boolean archivingForced); }
UserMessageStanzaBroker extends DelegatingStanzaBroker { @Override public void writeToSession(Stanza stanza) { super.writeToSession(archive(stanza)); } UserMessageStanzaBroker(StanzaBroker delegate, ServerRuntimeContext serverRuntimeContext,
            SessionContext sessionContext, boolean isOutbound, boolean archivingForced); @Override void write(Entity receiver, Stanza stanza, DeliveryFailureStrategy deliveryFailureStrategy); @Override void writeToSession(Stanza stanza); }
UserMessageStanzaBroker extends DelegatingStanzaBroker { @Override public void writeToSession(Stanza stanza) { super.writeToSession(archive(stanza)); } UserMessageStanzaBroker(StanzaBroker delegate, ServerRuntimeContext serverRuntimeContext,
            SessionContext sessionContext, boolean isOutbound, boolean archivingForced); @Override void write(Entity receiver, Stanza stanza, DeliveryFailureStrategy deliveryFailureStrategy); @Override void writeToSession(Stanza stanza);  }