### Question:
OAuthResponseParams { public boolean sendTraceToClient() { return sendTraceToClient; } OAuthResponseParams(SecurityToken securityToken, HttpRequest originalRequest,
      BlobCrypter stateCrypter); void logDetailedWarning(String classname, String method, String msgKey); void logDetailedWarning(String classname, String method, String msgKey, Throwable e); void logDetailedInfo(String classname, String method, String msgKey, Throwable e); void logDetailedWarning(String note); void logDetailedWarning(String note, Throwable e); void logDetailedInfo(String note, Throwable e); void addRequestTrace(HttpRequest request, HttpResponse response); boolean sawErrorResponse(); void addToResponse(HttpResponseBuilder response, OAuthRequestException e); OAuthClientState getNewClientState(); String getAznUrl(); void setAznUrl(String aznUrl); boolean sendTraceToClient(); void setSendTraceToClient(boolean sendTraceToClient); static final String CLIENT_STATE; static final String APPROVAL_URL; static final String ERROR_CODE; static final String ERROR_TEXT; }### Answer:
@Test public void testSendTraceToClient() { OAuthRequestException e = new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION, "whoa there cowboy"); params.addRequestTrace(null, null); params.addRequestTrace(null, null); HttpResponseBuilder responseBuilder = new HttpResponseBuilder(); params.addToResponse(responseBuilder, e); HttpResponse response = responseBuilder.create(); String errorText = response.getMetadata().get("oauthErrorText"); assertEquals("whoa there cowboy", errorText); params.setSendTraceToClient(true); params.addToResponse(responseBuilder, e); response = responseBuilder.create(); errorText = response.getMetadata().get("oauthErrorText"); checkStringContains("includes error text", errorText, "whoa there cowboy"); checkStringContains("Request 1 logged", errorText, "Sent request 1:\n\n"); checkStringContains("Request 2 logged", errorText, "Sent request 2:\n\n"); }