diff options
Diffstat (limited to 'core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java')
-rw-r--r-- | core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java b/core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java index 87b3782..8ce49e1 100644 --- a/core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java +++ b/core/src/test/java/fi/iki/elonen/HttpDeleteRequestTest.java @@ -42,8 +42,7 @@ public class HttpDeleteRequestTest extends HttpServerTest { @Test public void testDeleteRequestThatDoesntSendBackResponseBody_EmptyString() throws Exception { - this.testServer.response = new NanoHTTPD(0) { - }.newFixedLengthResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, ""); + this.testServer.response = NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, ""); ByteArrayOutputStream outputStream = invokeServer("DELETE " + HttpServerTest.URI + " HTTP/1.1"); @@ -61,8 +60,7 @@ public class HttpDeleteRequestTest extends HttpServerTest { @Test public void testDeleteRequestThatDoesntSendBackResponseBody_NullInputStream() throws Exception { - this.testServer.response = new NanoHTTPD(0) { - }.newChunkedResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, (InputStream) null); + this.testServer.response = NanoHTTPD.newChunkedResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, (InputStream) null); ByteArrayOutputStream outputStream = invokeServer("DELETE " + HttpServerTest.URI + " HTTP/1.1"); @@ -80,8 +78,7 @@ public class HttpDeleteRequestTest extends HttpServerTest { @Test public void testDeleteRequestThatDoesntSendBackResponseBody_NullString() throws Exception { - this.testServer.response = new NanoHTTPD(0) { - }.newFixedLengthResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, (String) null); + this.testServer.response = NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Response.Status.NO_CONTENT, NanoHTTPD.MIME_HTML, (String) null); ByteArrayOutputStream outputStream = invokeServer("DELETE " + HttpServerTest.URI + " HTTP/1.1"); @@ -99,8 +96,7 @@ public class HttpDeleteRequestTest extends HttpServerTest { @Test public void testDeleteRequestThatSendsBackResponseBody_Accepted() throws Exception { - this.testServer.response = new NanoHTTPD(0) { - }.newFixedLengthResponse(NanoHTTPD.Response.Status.ACCEPTED, "application/xml", "<body />"); + this.testServer.response = NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Response.Status.ACCEPTED, "application/xml", "<body />"); ByteArrayOutputStream outputStream = invokeServer("DELETE " + HttpServerTest.URI + " HTTP/1.1"); @@ -119,8 +115,7 @@ public class HttpDeleteRequestTest extends HttpServerTest { @Test public void testDeleteRequestThatSendsBackResponseBody_Success() throws Exception { - this.testServer.response = new NanoHTTPD(0) { - }.newFixedLengthResponse(NanoHTTPD.Response.Status.OK, "application/xml", "<body />"); + this.testServer.response = NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Response.Status.OK, "application/xml", "<body />"); ByteArrayOutputStream outputStream = invokeServer("DELETE " + HttpServerTest.URI + " HTTP/1.1"); |