Merge branch 'master' of https://github.com/keerthigadde/tutorials into JAVA-12099/move-java-numbers
Conflicts: core-java-modules/java-numbers-4/src/test/java/com/baeldung/bigdecimalzero/BigDecimalZeroChkUnitTest.java
This commit is contained in:
commit
ace8e6a79f
@ -5,4 +5,5 @@ This module contains articles about the Java List collection
|
||||
### Relevant Articles:
|
||||
- [Working With a List of Lists in Java](https://www.baeldung.com/java-list-of-lists)
|
||||
- [Reverse an ArrayList in Java](https://www.baeldung.com/java-reverse-arraylist)
|
||||
- [Sort a List Alphabetically in Java](https://www.baeldung.com/java-sort-list-alphabetically)
|
||||
- [[<-- Prev]](/core-java-modules/core-java-collections-list-3)
|
||||
|
@ -0,0 +1,34 @@
|
||||
package com.baeldung.bigdecimalzero;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class BigDecimalZeroChkUnitTest {
|
||||
private static final BigDecimal BD1 = new BigDecimal("0");
|
||||
private static final BigDecimal BD2 = new BigDecimal("0.0000");
|
||||
|
||||
@Test
|
||||
void givenBD_whenCheckedWithEquals_shouldCheckedAsZero() {
|
||||
assertThat(BigDecimal.ZERO.equals(BD1)).isTrue();
|
||||
|
||||
// in the article, we show the failure of the assertion below
|
||||
// assertThat(BigDecimal.ZERO.equals(BD2)).isTrue();
|
||||
|
||||
assertThat(BigDecimal.ZERO.equals(BD2)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenBD_whenCheckedWithCompareTo_shouldCheckedAsZero() {
|
||||
assertThat(BigDecimal.ZERO.compareTo(BD1)).isSameAs(0);
|
||||
assertThat(BigDecimal.ZERO.compareTo(BD2)).isSameAs(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenBD_whenCheckedWithSignum_shouldCheckedAsZero() {
|
||||
assertThat(BD1.signum()).isSameAs(0);
|
||||
assertThat(BD2.signum()).isSameAs(0);
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.docker</groupId>
|
||||
<artifactId>docker</artifactId>
|
||||
<artifactId>docker-modules</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.docker</groupId>
|
||||
<artifactId>docker</artifactId>
|
||||
<artifactId>docker-modules</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.docker</groupId>
|
||||
<artifactId>docker</artifactId>
|
||||
<artifactId>docker-modules</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.docker</groupId>
|
||||
<artifactId>docker</artifactId>
|
||||
<artifactId>docker-modules</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
@ -4,9 +4,9 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.docker</groupId>
|
||||
<artifactId>docker</artifactId>
|
||||
<artifactId>docker-modules</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<name>docker</name>
|
||||
<name>docker-modules</name>
|
||||
<description>Demo project showing Spring Boot and Docker</description>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.graphql</groupId>
|
||||
<artifactId>graphql</artifactId>
|
||||
<artifactId>graphql-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.graphql</groupId>
|
||||
<artifactId>graphql</artifactId>
|
||||
<artifactId>graphql-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user