File tree Expand file tree Collapse file tree 3 files changed +1
-16
lines changed
Expand file tree Collapse file tree 3 files changed +1
-16
lines changed Original file line number Diff line number Diff line change 77
88public 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 ;
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 11package httpserver ;
22
3- import org .junit .Ignore ;
43import org .junit .Test ;
54
65import 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 \n Host: 0.0.0.0:5000\r \n User-Agent: curl/7.54.0\r \n Accept: */*\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 \n Host: 0.0.0.0:5000\r \n User-Agent: curl/7.54.0\r \n Accept: */*\r \n \r \n " ;
32-
33- Request request = requestForInput (input );
34-
3526 assertEquals ("/text-file.txt" , request .getPath ());
3627 }
3728
You can’t perform that action at this time.
0 commit comments