params.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION, "whoa there cowboy");
params.addRequestTrace(null, null);
params.addRequestTrace(null, null);
params.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION, "whoa there cowboy");
HttpResponseBuilder responseBuilder = new HttpResponseBuilder();
params.addToResponse(responseBuilder);
HttpResponse response = responseBuilder.create();
String errorText = response.getMetadata().get("oauthErrorText");
assertEquals("whoa there cowboy", errorText);
params.setSendTraceToClient(true);
params.addToResponse(responseBuilder);
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");
}