man, this modern Mockito/Hamcrest stuff really sucks; reverted assertThat and closeTo to traditional assertTrue

This commit is contained in:
Axel Uhl committed 2015-01-05 23:09:09 +01:00
1 parent cff6226fa4
commit 157e077589
2 files changed
+7 -10

No files matched your search

@@ -8,13 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Fragment-Host: com.sap.sailing.polars
Import-Package: com.sap.sailing.domain.test.mock,
com.sap.sse.common,
com.sap.sse.common.impl,
org.hamcrest;version="1.1.0",
org.hamcrest.core;version="1.1.0",
org.hamcrest.number;version="1.1.0",
org.junit;version="4.8.2",
org.junit.runner;version="4.8.2",
org.mockito;version="1.10.14",
org.mockito.stubbing;version="1.10.14"
com.sap.sse.common.impl
Require-Bundle: org.hamcrest;bundle-version="1.1.0",
org.hamcrest.core;bundle-version="1.1.0"
org.hamcrest.core;bundle-version="1.1.0",
org.mockito.mockito-core;bundle-version="1.10.14",
org.junit4;bundle-version="4.8.2"
@@ -5,6 +5,7 @@ import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
@@ -203,7 +204,8 @@ public class WindSpeedAndAngleEstimatorTest {
.getAverageTrueWindSpeedAndAngleCandidates(new KnotSpeedImpl(4.3));
assertThat(result.size(), is(2));
for (SpeedWithBearingWithConfidence<Void> candidate : result) {
assertThat(candidate.getConfidence(), anyOf(closeTo(0.2999999, ERROR), closeTo(0.54, ERROR)));
assertTrue(Math.abs(candidate.getConfidence()-0.2999999)<=ERROR ||
Math.abs(candidate.getConfidence()-0.54)<=ERROR);
if (Math.abs(candidate.getConfidence() - 0.2999999) < ERROR) {
assertThat(candidate.getObject().getKnots(), closeTo(7.8, ERROR));
assertThat(candidate.getObject().getBearing().getDegrees(), closeTo(47.5, ERROR));