Skip to content

Commit

Permalink
Fix test error on travis-ci.org #Build #17
Browse files Browse the repository at this point in the history
  • Loading branch information
gudaoxuri committed Jun 1, 2017
1 parent 48cd9f6 commit b9a8304
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/test/java/com/ecfront/dew/common/HttpHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public void testHttp() throws Exception {
Assert.assertEquals("1", $.json.toJson(result).get("form").get("a").asText());
// post - file
result = $.http.post("https://httpbin.org/post", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
System.out.println(result);
Assert.assertEquals("{\r\n \"a\":1\r\n}", $.json.toJson(result).get("files").get("conf1.json").asText());
Assert.assertEquals("1", $.json.toJson($.json.toJson(result).get("files").get("conf1.json").asText()).get("a").asText());
// put - data
result = $.http.put("https://httpbin.org/put", "some data");
Assert.assertEquals("some data", $.json.toJson(result).get("data").asText());
Expand All @@ -52,10 +51,10 @@ public void testHttp() throws Exception {
Assert.assertEquals("1", $.json.toJson(result).get("form").get("a").asText());
// put - file
result = $.http.put("https://httpbin.org/put", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
Assert.assertEquals("{\r\n \"a\":1\r\n}", $.json.toJson(result).get("files").get("conf1.json").asText());
Assert.assertEquals("1", $.json.toJson($.json.toJson(result).get("files").get("conf1.json").asText()).get("a").asText());
// put with head
HttpHelper.WrapHead wrapHead = $.http.putWithHead("https://httpbin.org/put", new File(this.getClass().getResource("/").getPath() + "conf1.json"));
Assert.assertEquals("{\r\n \"a\":1\r\n}", $.json.toJson(wrapHead.result).get("files").get("conf1.json").asText());
Assert.assertEquals("1", $.json.toJson($.json.toJson(result).get("files").get("conf1.json").asText()).get("a").asText());
Assert.assertEquals("application/json", wrapHead.head.get("Content-Type"));
// head
Map<String, String> head = $.http.head("https://httpbin.org/get");
Expand Down

0 comments on commit b9a8304

Please sign in to comment.