### Question:
OAuthResponseParams { public void addRequestTrace(HttpRequest request, HttpResponse response) { this.requestTrace.add(Pair.of(request, response)); } 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 testException() { HttpRequest req = new HttpRequest(Uri.parse("http: HttpResponse ok = new HttpResponseBuilder().setHttpStatusCode(200).create(); params.addRequestTrace(req, ok); OAuthRequestException e = new OAuthRequestException("error", "errorText"); checkStringContains(e.toString(), "[error,errorText]"); params.addRequestTrace(null, null); Throwable cause = new RuntimeException(); e = new OAuthRequestException(OAuthError.UNAUTHENTICATED, "errorText", cause); checkStringContains(e.toString(), "[UNAUTHENTICATED,Unauthenticated OAuth fetch]"); assertEquals(cause, e.getCause()); }