String expectedStatus,
String expectedActionStatus,
ProtocolVersion protocolVersion,
String errorResponseHeaderName) throws Exception
{
RestResponse response;
final Status status = buildStatusRecord();
final GetResult<Status> getResult = new GetResult<Status>(status, HttpStatus.S_500_INTERNAL_SERVER_ERROR);
response = invokeResponseHandler("/test", getResult, ResourceMethod.GET, acceptTypeData.acceptHeaders, protocolVersion);
checkResponse(response, HttpStatus.S_500_INTERNAL_SERVER_ERROR.getCode(), 2, acceptTypeData.responseContentType, Status.class.getName(), null, true, errorResponseHeaderName);
assertEquals(response.getEntity().asAvroString(), expectedStatus);
final RestRequest request = buildRequest(acceptTypeData.acceptHeaders, protocolVersion);
final ActionResult<Status> actionResult = new ActionResult<Status>(status, HttpStatus.S_500_INTERNAL_SERVER_ERROR);
response = _responseHandler.buildResponse(request,
buildRoutingResultAction(Status.class, request, acceptTypeData.acceptHeaders),
actionResult);
checkResponse(response,
HttpStatus.S_500_INTERNAL_SERVER_ERROR.getCode(),
2,
acceptTypeData.responseContentType,
ActionResponse.class.getName(),
Status.class.getName(),
true,
errorResponseHeaderName);
assertEquals(response.getEntity().asAvroString(), expectedActionStatus);
}