DefaultWorldpayConnector implements WorldpayConnector { @Override public void logXMLOut(final PaymentService paymentService) { try { LOG.info("*** XML OUT ***"); LOG.info(paymentServiceMarshaller.marshal(paymentService)); LOG.info("*** XML OUT END ***"); } catch (final WorldpayException e) { LOG.debug("There was an error marshalling the paymentService for debug logging", e); } } DefaultWorldpayConnector(PaymentServiceMarshaller paymentServiceMarshaller, ConfigurationService configurationService, RestTemplate restTemplate); @Override ServiceReply send(final PaymentService outboundPaymentService, final MerchantInfo merchantInfo, final String cookie); @Override void logXMLOut(final PaymentService paymentService);  }
@Test public void logXMLShouldMarshalPaymentService() throws WorldpayException { testObj.logXMLOut(paymentServiceRequestMock); verify(paymentServiceMarshallerMock).marshal(paymentServiceRequestMock); }