Skip to content

Commit a59061b

Browse files
committed
Remove commented out Methods and consolidate two tests in RequestParser
1 parent 9b0c18d commit a59061b

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/main/java/httpserver/Method.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77

88
public enum Method {
99
GET(new GetResponder()),
10-
//HEAD(null),
1110
POST(new PostResponder()),
1211
PUT(new PutResponder()),
13-
//DELETE(null),
14-
//OPTIONS(null),
1512
INVALID(new InvalidMethodResponder());
1613

1714
private final Responder responder;

src/test/java/httpserver/MethodTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ public class MethodTest {
88
@Test
99
public void valuesAreGetPost() throws Exception {
1010
assertNotNull(Method.GET);
11-
//assertNotNull(Method.HEAD);
1211
assertNotNull(Method.POST);
1312
assertNotNull(Method.PUT);
14-
//assertNotNull(Method.DELETE);
15-
//assertNotNull(Method.OPTIONS);
1613
}
1714
}

src/test/java/httpserver/RequestParserTest.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package httpserver;
22

3-
import org.junit.Ignore;
43
import org.junit.Test;
54

65
import java.io.ByteArrayInputStream;
@@ -18,20 +17,12 @@ public RequestParserTest() {
1817
}
1918

2019
@Test
21-
public void parsesMethod() throws Exception {
20+
public void parsesMethodAndPath() throws Exception {
2221
String input = "GET /text-file.txt HTTP/1.1\r\nHost: 0.0.0.0:5000\r\nUser-Agent: curl/7.54.0\r\nAccept: */*\r\n\r\n";
2322

2423
Request request = requestForInput(input);
2524

2625
assertEquals(Method.GET, request.getMethod());
27-
}
28-
29-
@Test
30-
public void parsesPath() throws Exception {
31-
String input = "GET /text-file.txt HTTP/1.1\r\nHost: 0.0.0.0:5000\r\nUser-Agent: curl/7.54.0\r\nAccept: */*\r\n\r\n";
32-
33-
Request request = requestForInput(input);
34-
3526
assertEquals("/text-file.txt", request.getPath());
3627
}
3728

0 commit comments

Comments
 (0)