@Test public void testLogRequestDetails_success_debugLevelEnabled() { when(soapXmlLogger.isDebugEnabled()).thenReturn(true); loggerDelegate.logRequestDetails(remoteCallReturn); verify(soapXmlLogger) .debug( RemoteCallLoggerDelegate.DETAILS_REQUEST_TEMPLATE, RemoteCallType.SOAP, prettyRequest); verify(soapXmlLogger) .debug( RemoteCallLoggerDelegate.DETAILS_RESPONSE_TEMPLATE, RemoteCallType.SOAP, prettyResponse); }
public void logRequestDetails(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isDetailsLoggable(isSuccess)) { return; } String prettyRequest = null; if (remoteCallReturn.getRequestInfo() != null) { prettyRequest = prettyPrinter.prettyPrint(remoteCallReturn.getRequestInfo().getPayload()); } String prettyResponse = null; if (remoteCallReturn.getResponseInfo() != null) { prettyResponse = prettyPrinter.prettyPrint(remoteCallReturn.getResponseInfo().getPayload()); } if (isSuccess) { detailLogger.debug(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.debug(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } else { detailLogger.info(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.info(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } }
RemoteCallLoggerDelegate { public void logRequestDetails(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isDetailsLoggable(isSuccess)) { return; } String prettyRequest = null; if (remoteCallReturn.getRequestInfo() != null) { prettyRequest = prettyPrinter.prettyPrint(remoteCallReturn.getRequestInfo().getPayload()); } String prettyResponse = null; if (remoteCallReturn.getResponseInfo() != null) { prettyResponse = prettyPrinter.prettyPrint(remoteCallReturn.getResponseInfo().getPayload()); } if (isSuccess) { detailLogger.debug(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.debug(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } else { detailLogger.info(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.info(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } } }
RemoteCallLoggerDelegate { public void logRequestDetails(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isDetailsLoggable(isSuccess)) { return; } String prettyRequest = null; if (remoteCallReturn.getRequestInfo() != null) { prettyRequest = prettyPrinter.prettyPrint(remoteCallReturn.getRequestInfo().getPayload()); } String prettyResponse = null; if (remoteCallReturn.getResponseInfo() != null) { prettyResponse = prettyPrinter.prettyPrint(remoteCallReturn.getResponseInfo().getPayload()); } if (isSuccess) { detailLogger.debug(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.debug(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } else { detailLogger.info(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.info(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); }
RemoteCallLoggerDelegate { public void logRequestDetails(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isDetailsLoggable(isSuccess)) { return; } String prettyRequest = null; if (remoteCallReturn.getRequestInfo() != null) { prettyRequest = prettyPrinter.prettyPrint(remoteCallReturn.getRequestInfo().getPayload()); } String prettyResponse = null; if (remoteCallReturn.getResponseInfo() != null) { prettyResponse = prettyPrinter.prettyPrint(remoteCallReturn.getResponseInfo().getPayload()); } if (isSuccess) { detailLogger.debug(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.debug(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } else { detailLogger.info(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.info(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); boolean isSummaryLoggable(boolean isSuccess); boolean isDetailsLoggable(boolean isSuccess); void logRequestDetails(RemoteCallReturn remoteCallReturn); void logRequestSummary(RemoteCallReturn remoteCallReturn); }
RemoteCallLoggerDelegate { public void logRequestDetails(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isDetailsLoggable(isSuccess)) { return; } String prettyRequest = null; if (remoteCallReturn.getRequestInfo() != null) { prettyRequest = prettyPrinter.prettyPrint(remoteCallReturn.getRequestInfo().getPayload()); } String prettyResponse = null; if (remoteCallReturn.getResponseInfo() != null) { prettyResponse = prettyPrinter.prettyPrint(remoteCallReturn.getResponseInfo().getPayload()); } if (isSuccess) { detailLogger.debug(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.debug(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } else { detailLogger.info(DETAILS_REQUEST_TEMPLATE, remoteCallType, prettyRequest); detailLogger.info(DETAILS_RESPONSE_TEMPLATE, remoteCallType, prettyResponse); } } RemoteCallLoggerDelegate(
      Logger summaryLogger,
      Logger detailLogger,
      @Nullable PrettyPrinterInterface prettyPrinter,
      RemoteCallType remoteCallType); boolean isSummaryLoggable(boolean isSuccess); boolean isDetailsLoggable(boolean isSuccess); void logRequestDetails(RemoteCallReturn remoteCallReturn); void logRequestSummary(RemoteCallReturn remoteCallReturn);  }