@Test
    void produceIsCalledWhenResponseCanceled() throws Exception {
        final HttpResponseWriter response = HttpResponse.streaming();
        response.write(ResponseHeaders.of(200));
        response.write(HttpData.ofUtf8("foo"));

        final ContentPreviewer contentPreviewer = contentPreviewer();
        final ServiceRequestContext ctx = ServiceRequestContext.of(HttpRequest.of(HttpMethod.GET, "/"));

        final ContentPreviewerFactory factory = mock(ContentPreviewerFactory.class);
        when(factory.responseContentPreviewer(any(), any())).thenReturn(contentPreviewer);
        final HttpResponse filteredResponse = ContentPreviewingUtil.setUpResponseContentPreviewer(
                factory, ctx, response, Functions.second());
        filteredResponse.subscribe(new CancelSubscriber());

        assertThat(ctx.log()
                      .whenAvailable(RequestLogProperty.RESPONSE_CONTENT_PREVIEW)
                      .join()
                      .responseContentPreview()).isEqualTo("foo");
    }
Unlike {@link #contentPreviewBeforeEncoding()}, the content preview of this test is encoded data
because the previewing decorator is inserted after {@link EncodingService}.
core/src/test/java/com/linecorp/armeria/server/logging/ContentPreviewingServiceTest.java