-
Notifications
You must be signed in to change notification settings - Fork 18
unexpected behavior in "Guava assertions quickstart guide" #15
Comments
I'm not able to reproduce the problem after using guava 18.0, assertj-core 1.7.1 and assertj-guava 1.3.0 in assertj-examples master branch. What is your environment ? Mine was:
|
java.runtime.version=1.7.0_60-b19 but I get the same result with java 8 (java.runtime.version=1.8.0_25-b18) My full source code is here: https://gist.github.com/lbalazscs/c4c7b395f6e3b46c9a88 |
I debugged a little bit, and found that the problem is the hasUpperEndpointEqualTo method of RangeAssert: in the line
12 is compared to 10 in the equals method of Integer. I am not sure what should happen here - if I understand correctly, the upper bound is 12, and the test should fail, but the error message (expected 10, found 10) is incorrect even if the test is supposed to fail. |
Ok, I was able to reproduce the problem, this is a bug in the error message, assertion is correct but the error message is not as it uses the lower end point instead the upper one. |
I also have fixed http://joel-costigliola.github.io/assertj/assertj-guava.html#quickstart |
I have just release assertj-guava 1.3.1, should be soon available in maven central. |
Yes, the 1.3.1 code is OK, but note that the webpage at http://joel-costigliola.github.io/assertj/assertj-guava.html#quickstart still recommends the use of version 1.3.0 (in the "1 - Add assertj-guava dependency to your project pom.xml" step)... |
I know that, I was just waiting the version to be available in maven central, will update that today along with the release notes. |
Using guava 18.0, assertj-core 1.7.1 and assertj-guava 1.3.0, the example program shows the following message:
Expected 10, but found 10???
The code in question is the following:
The full code is at http://joel-costigliola.github.io/assertj/assertj-guava.html#quickstart
The text was updated successfully, but these errors were encountered: