<commit_before>package org.zalando.logbook.httpclient;

import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.BasicHttpResponse;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringBufferInputStream;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;

public final class RemoteResponseTest {

    @Rule
    public final ExpectedException exception = ExpectedException.none();

    private final BasicHttpEntity basicHttpEntity = new BasicHttpEntity();
    private final HttpResponse delegate = new BasicHttpResponse(new ProtocolVersion("HTTP", 1, 1), 200, "OK");
    private final RemoteResponse unit = new RemoteResponse(delegate);

    @Before
    public void setUpResponseBody() {
        basicHttpEntity.setContent(new ByteArrayInputStream("fooBar".getBytes(StandardCharsets.UTF_8)));<commit_msg>Issue #135: Copy the chunked flag and the ContentEncoding/ContentType headers to the new ByteArrayEntity when replacing the response body - Removed unused imports<commit_after>package org.zalando.logbook.httpclient;

import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.BasicHttpResponse;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;

public final class RemoteResponseTest {

    @Rule
    public final ExpectedException exception = ExpectedException.none();

    private final BasicHttpEntity basicHttpEntity = new BasicHttpEntity();
    private final HttpResponse delegate = new BasicHttpResponse(new ProtocolVersion("HTTP", 1, 1), 200, "OK");
    private final RemoteResponse unit = new RemoteResponse(delegate);

    @Before
    public void setUpResponseBody() {
        basicHttpEntity.setContent(new ByteArrayInputStream("fooBar".getBytes(StandardCharsets.UTF_8)));
{'fraction_non_alphanumeric': 0.08854166666666667, 'fraction_numerical': 0.006324404761904762, 'mean_word_length': 5.877237851662404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7594169', 'n_tokens_mistral': 755, 'n_tokens_neox': 731, 'n_words': 180}