### Question:
RemoteCallLoggerDelegate { public void logRequestSummary(RemoteCallReturn remoteCallReturn) { if (remoteCallReturn == null) { return; } boolean isSuccess = remoteCallReturn.getException() == null; if (!isSummaryLoggable(isSuccess)) { return; } RequestInfo request = remoteCallReturn.getRequestInfo(); ResponseInfo response = remoteCallReturn.getResponseInfo(); Object[] logArgs = new Object[10]; if (request != null) { logArgs[0] = request.getServiceName(); logArgs[1] = request.getMethodName(); logArgs[2] = request.getContextName(); logArgs[3] = request.getContextValue(); logArgs[4] = request.getUrl(); } if (response != null) { logArgs[5] = response.getRequestId(); logArgs[6] = response.getResponseTime(); logArgs[7] = response.getOperationsCount(); Throwable throwable = remoteCallReturn.getException(); logArgs[8] = throwable != null; logArgs[9] = truncateThrowable(throwable, MAX_SUMMARY_ERROR_LENGTH); } if (isSuccess) { summaryLogger.info(SUMMARY_TEMPLATE, logArgs); } else { summaryLogger.warn(SUMMARY_TEMPLATE, logArgs); } } 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);  }### Answer:
@Test public void testLogRequestSummary_success() { when(requestInfoLogger.isInfoEnabled()).thenReturn(true); loggerDelegate.logRequestSummary(remoteCallReturn); RequestInfo requestInfo = remoteCallReturn.getRequestInfo(); ResponseInfo responseInfo = remoteCallReturn.getResponseInfo(); verify(requestInfoLogger) .info( RemoteCallLoggerDelegate.SUMMARY_TEMPLATE, requestInfo.getServiceName(), requestInfo.getMethodName(), requestInfo.getContextName(), requestInfo.getContextValue(), requestInfo.getUrl(), responseInfo.getRequestId(), responseInfo.getResponseTime(), responseInfo.getOperationsCount(), false, null); }
@Test public void testLogRequestSummary_failure() { Throwable returnedException = new Throwable(); remoteCallReturn = new RemoteCallReturn.Builder() .withRequestInfo(remoteCallReturn.getRequestInfo()) .withResponseInfo(remoteCallReturn.getResponseInfo()) .withException(returnedException) .build(); when(requestInfoLogger.isWarnEnabled()).thenReturn(true); loggerDelegate.logRequestSummary(remoteCallReturn); RequestInfo requestInfo = remoteCallReturn.getRequestInfo(); ResponseInfo responseInfo = remoteCallReturn.getResponseInfo(); verify(requestInfoLogger) .warn( RemoteCallLoggerDelegate.SUMMARY_TEMPLATE, requestInfo.getServiceName(), requestInfo.getMethodName(), requestInfo.getContextName(), requestInfo.getContextValue(), requestInfo.getUrl(), responseInfo.getRequestId(), responseInfo.getResponseTime(), responseInfo.getOperationsCount(), true, returnedException.toString()); }