sessionContext.setSessionState(SessionState.AUTHENTICATED);
CallTestStanzaHandlerResponse stanzaHandler = new CallTestStanzaHandlerResponse("ProtocolWorkerProcessTestCase");
namespaceHandlerDictionary.register(stanzaHandler);
Stanza stanza = new StanzaBuilder("ProtocolWorkerProcessTestCase", "testNSURI").build();
Stanza responseStanza = new StanzaBuilder("response").build();
stanzaHandler.setResponseStanza(responseStanza);
protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza, sessionStateHolder);
stanzaHandler.assertHandlerCalled();
Stanza recordedResponse = sessionContext.getNextRecordedResponse();
assertEquals("response handled", responseStanza, recordedResponse);
stanzaHandler.setResponseStanza(null);
protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza, sessionStateHolder);
assertNull("handler emmitted null as response", stanzaHandler.getResponseStanza());