@Test
    public void testIsInvalid_addressedAtThirdPartyServer_unauthenticated() throws Exception
    {
        // Setup test fixture.
        final Packet stanza = new Message();
        stanza.setTo(new JID(null, "makedifferent" + XMPPServer.getInstance().getServerInfo().getXMPPDomain(), null));
        final LocalClientSession session = mock(LocalClientSession.class, withSettings().strictness(Strictness.LENIENT));
        when(session.getStatus()).thenReturn(Session.Status.CONNECTED); // Openfire sets 'AUTHENTICATED' only after resource binding has been done.

        // Execute system under test.
        final boolean result = SessionPacketRouter.isInvalidStanzaSentPriorToResourceBinding(stanza, session);

        // Verify results.
        assertTrue(result);
    }
Tests the implementation of {@link SessionPacketRouter#isInvalidStanzaSentPriorToResourceBinding(Packet, ClientSession)}
by sending a stanza that is addressed to a third party server on a session that has not completed resource
binding.

Stanzas addressed to other clients or servers are invalid (per RFC 6120, section 7.1). The method under test
should not accept the stanza.
xmppserver/src/test/java/org/jivesoftware/openfire/SessionPacketRouterTest.java