wenhao001 / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

JSON Parser not able to parse numbers into double or float #416

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. HTTP service returns body {"number": 0.0}
2. trying to match this with then().body("number", Matchers.closeTo(0.0, 0.001))

What is the expected output? What do you see instead?
Expect the match to succeed, fails instead with error message

java.lang.AssertionError: JSON path number doesn't match.
Expected: a numeric value within <0.001> of <0.0>
  Actual: 0.0

What version of the product are you using? On what operating system?
OS: Mac OS X 10.10.4, Product Version: 2.4.1 from maven repository

Attached is a minimal working example project.

Original issue reported on code.google.com by s.suerb...@googlemail.com on 16 Jul 2015 at 4:18

Attachments: