diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java index ce2f171051..96b644c46c 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/EllipticalMercatorUnitTest.java @@ -1,21 +1,22 @@ package com.baeldung.algorithms.mercator; +import org.junit.Assert; import org.junit.Test; public class EllipticalMercatorUnitTest { @Test - public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.xAxisProjection(22); - assert result == 2449028.7974520186; + Assert.assertEquals(result, 2449028.7974520186, 0.0); } @Test - public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new EllipticalMercator(); double result = mercator.yAxisProjection(44); - assert result == 5435749.887511954; + Assert.assertEquals(result, 5435749.887511954, 0.0); } } diff --git a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java index bbb34302ed..348c6ad3e4 100644 --- a/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java +++ b/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/mercator/SphericalMercatorUnitTest.java @@ -1,21 +1,21 @@ package com.baeldung.algorithms.mercator; +import org.junit.Assert; import org.junit.Test; -import static junit.framework.TestCase.assertEquals; public class SphericalMercatorUnitTest { @Test - public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.xAxisProjection(22); - assert result == 2449028.7974520186; + Assert.assertEquals(result, 2449028.7974520186, 0.0); } @Test - public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { + public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() { Mercator mercator = new SphericalMercator(); double result = mercator.yAxisProjection(44); - assert result == 5465442.183322753; + Assert.assertEquals(result, 5465442.183322753, 0.0); } }