Skip to content

Commit f8a18ae

Browse files
Use assertj core 3.15.1-SNAPSHOT
1 parent cbd5b98 commit f8a18ae

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

assertions-examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<properties>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323
<neo4j.version>3.0.0</neo4j.version>
24-
<assertj-core.version>3.15.0</assertj-core.version>
24+
<assertj-core.version>3.15.1-SNAPSHOT</assertj-core.version>
2525
</properties>
2626

2727
<dependencyManagement>

assertions-examples/src/test/java/org/assertj/examples/NumberAssertionsExamples.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void number_assertions_with_offset_examples() {
264264
}
265265

266266
@Test
267-
public void testName() {
267+
public void isNotCloseTo_examples() {
268268
final BigInteger eight = new BigInteger("8");
269269
final BigInteger ten = BigInteger.TEN;
270270

@@ -351,4 +351,20 @@ public void should_handle_NaN_and_infinity_correctly_fixing_issue_984() {
351351
fail("assertThat(Double.NaN).isCloseTo(0.007, withPercentage(0.1)) should have failed");
352352
}
353353

354+
@Test
355+
public void should_behave_according_to_whether_expected_value_is_primitive_or_not() {
356+
// JDK behavior
357+
assertThat(Double.NaN != Double.NaN).isTrue();
358+
assertThat(Double.valueOf(Double.NaN).equals(Double.NaN)).isTrue();
359+
assertThat(-0.0 == 0.0).isTrue();
360+
assertThat(Double.valueOf(0.0).equals(-0.0)).isFalse();
361+
// AssertJ behavior
362+
assertThat(0.0).isEqualTo(-0.0);
363+
assertThat(-0.0).isEqualTo(0.0);
364+
assertThat(0.0).isNotEqualTo(Double.valueOf(-0.0));
365+
assertThat(Double.NaN).isNotEqualTo(Double.NaN);
366+
assertThat(Double.NaN).isEqualTo(Double.valueOf(Double.NaN));
367+
assertThat(-0.0).isZero();
368+
}
369+
354370
}

assertions-examples/src/test/java/org/assertj/examples/data/BasketBallAssertExamples.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
import org.junit.jupiter.api.Test;
1818

1919
/**
20-
*
20+
*
2121
* Shows some example of a custom assertion class: {@link org.assertj.examples.custom.TolkienCharacterAssert} that
2222
* allows us to make assertions specific to {@link org.assertj.examples.data.TolkienCharacter}.
2323
* <p>
24-
* YOU NEED TO GENERATE ASSERTIONS FOR THID CLASS TO COMPILE, YOU NEED TO EXECUTE THE FOLLOWING COMMAND :
24+
* YOU NEED TO GENERATE ASSERTIONS FOR THIS CLASS TO COMPILE, YOU NEED TO EXECUTE THE FOLLOWING COMMAND :
2525
* <pre>
2626
* mvn clean install
2727
* </pre>
28-
*
28+
*
2929
* @author Joel Costigliola
3030
*/
3131
public class BasketBallAssertExamples extends AbstractAssertionsExamples {

0 commit comments

Comments
 (0)