package net.zephyrizing.http_server_test;

import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import net.zephyrizing.http_server.HttpRequest;
import net.zephyrizing.http_server.HttpRequest.Method;
import net.zephyrizing.http_server.HttpResponse;

import net.zephyrizing.http_server.content.ContentProvider;
import net.zephyrizing.http_server.content.EmptyContentProvider;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.*;

public class HttpResponseTest {

    HttpRequest  request;
    HttpResponse response;

    @Before
    public void initialize() {
        request = new HttpRequest(Method.GET, "/", "1.1");
        response = HttpResponse.responseFor(request);
    }

    @Test
    public void hasStatusCode() {
        assertThat(response.status(), equalTo(200));
    }

    @Test
    public void hasSettableStatusCode() {
        int status = 500;
        response.setStatus(status);
        assertThat(response.status(), equalTo(status));
    }

    @Test
    public void isProtocolSame() {
        assertThat(response.protocolVersion(), equalTo(request.protocolVersion()));
    }

    @Test
    public void isProtocolSame10() {
        assertThat(response.protocolVersion(), equalTo(request.protocolVersion()));
    }

    @Test
    public void isOk() {
        response.setContent(new EmptyContentProvider());
        assertThat(response.getStatusLine(), equalTo("HTTP/1.1 200 OK"));
    }

    @Test
    public void isFourOhFour() {
        response.setStatus(404);
        assertThat(response.getStatusLine(), equalTo("HTTP/1.1 404 Not Found"));
    }

    @Test
    public void hasHeaders() {
        response.addHeader("Accept", "NOTHING");
        response.addHeader("Accept", "ToIt");
        response.addHeader("Wrong", "Things");
        assertThat(response.getHeaderStream().collect(Collectors.toList()),
                   hasItems("Accept: NOTHING,ToIt",
                            "Wrong: Things"));
    }
}

@@ -1112,16 +1112,17 @@
 tatus);%0A
+%0A
         
@@ -1316,146 +1316,8 @@
  %7D%0A%0A
-    @Test%0A    public void isProtocolSame10() %7B%0A        assertThat(response.protocolVersion(), equalTo(request.protocolVersion()));%0A    %7D%0A%0A
     
@@ -1400,24 +1400,25 @@
 rovider());%0A
+%0A
         asse
@@ -1562,16 +1562,17 @@
 s(404);%0A
+%0A
         
@@ -1783,24 +1783,24 @@
 %22, %22ToIt%22);%0A
-
         resp
@@ -1830,24 +1830,25 @@
  %22Things%22);%0A
+%0A
         asse

Add some readability whitespace to HttpResponse tests