@Test public void addSoapHeaderIfNooneIsOnMessage() throws SOAPException { backend.put("abcd", "12"); when(message.getSOAPHeader()).thenReturn(null); when(message.getSOAPPart()).thenReturn(mock(SOAPPart.class)); final SOAPEnvelope envelope = mock(SOAPEnvelope.class); when(message.getSOAPPart().getEnvelope()).thenReturn(envelope); when(message.getSOAPPart().getEnvelope().addHeader()).thenReturn(mock(SOAPHeader.class, Mockito.RETURNS_DEEP_STUBS)); unit.handleOutgoing(messageContext); verify(envelope).addHeader(); }
protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); @Override final boolean handleFault(final SOAPMessageContext context); }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); @Override final boolean handleFault(final SOAPMessageContext context);  }