'If the return value of the decorated function is an instance of
L{EndpointResponse} then the response generated:
- has the code given by the L{EndpointResponse} instance.
- has a I{Content-Type} header set to I{application/json}.
- has a JSON-encoded body indicating a successful response and
giving the result from the L{EndpointResponse} instance.'

@validateLogging(_assertRequestLogged('/foo/explicitresponse'))
def test_explicitResponseObject(self, logger):

    application = self.application(logger, {})
    request = dummyRequest('GET', '/foo/explicitresponse', Headers(), '')
    self.render(application.app.resource(), request)
    expected = CloseEnoughJSONResponse(application.EXPLICIT_RESPONSE_CODE, Headers({'content-type': ['application/json']}), application.EXPLICIT_RESPONSE_RESULT)
    return expected.verify(asResponse(request))
