protected boolean shouldAllowPreemptiveResponse(Channel channel) {
        // If the request timed-out while being read, then there won't have been any LastContent, but thats ok because
        // the connection will have to be discarded anyway.
        StatusCategory status =
                StatusCategoryUtils.getStatusCategory(ClientRequestReceiver.getRequestFromChannel(channel));
        return status == ZuulStatusCategory.FAILURE_CLIENT_TIMEOUT;
    }
@Test
    void exemptClientTimeoutResponseBeforeRequestRead() {
        final ClientResponseWriter responseWriter = new ClientResponseWriter(new BasicRequestCompleteHandler());
        final EmbeddedChannel channel = new EmbeddedChannel();

        final SessionContext context = new SessionContext();
        StatusCategoryUtils.setStatusCategory(context, ZuulStatusCategory.FAILURE_CLIENT_TIMEOUT);
        final HttpRequestMessage request = new HttpRequestBuilder(context).withDefaults();
        channel.attr(ClientRequestReceiver.ATTR_ZUUL_REQ).set(request);

        assertThat(responseWriter.shouldAllowPreemptiveResponse(channel)).isTrue();
    }