mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
fixed MarkPositionTImeFilterTest after introducing default methods for recordFix with overloads
Change-Id: I8b229022004fe1ebadfc795d03a1aad9ca6f86e0
This commit is contained in:
1 parent
0e16d0a9ee
commit
4e8ac24419
1 file changed
+7
-6
+7
-6
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.anyObject;
|
||||
import static org.mockito.Matchers.anyBoolean;
|
||||
import static org.mockito.Matchers.same;
|
||||
import static org.mockito.Mockito.doCallRealMethod;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -36,7 +37,7 @@ public class MarkPositionTimeFilterTest {
|
||||
m = new MarkImpl("Test Mark");
|
||||
track = new DynamicGPSFixTrackImpl<Mark>(m, /* millisecondsOverWhichToAverage */ 5000);
|
||||
when(trackedRace.getOrCreateTrack(m)).thenReturn(track);
|
||||
doCallRealMethod().when(trackedRace).recordFix(same(m), (GPSFixMoving) anyObject());
|
||||
doCallRealMethod().when(trackedRace).recordFix(same(m), (GPSFixMoving) anyObject(), anyBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -47,7 +48,7 @@ public class MarkPositionTimeFilterTest {
|
||||
@Test
|
||||
public void testAddFixForMark() {
|
||||
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), MillisecondsTimePoint.now(),
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))), /* onlyWhenInTrackingInterval */ true);
|
||||
track.lockForRead();
|
||||
try {
|
||||
assertEquals(1, track.getRawFixes().size());
|
||||
@@ -64,7 +65,7 @@ public class MarkPositionTimeFilterTest {
|
||||
when(trackedRace.getStartOfTracking()).thenReturn(start);
|
||||
when(trackedRace.getEndOfTracking()).thenReturn(end);
|
||||
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))), /* onlyWhenInTrackingInterval */ true);
|
||||
track.lockForRead();
|
||||
try {
|
||||
assertEquals(1, track.getRawFixes().size());
|
||||
@@ -81,7 +82,7 @@ public class MarkPositionTimeFilterTest {
|
||||
when(trackedRace.getStartOfTracking()).thenReturn(start);
|
||||
when(trackedRace.getEndOfTracking()).thenReturn(end);
|
||||
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))), /* onlyWhenInTrackingInterval */ true);
|
||||
track.lockForRead();
|
||||
try {
|
||||
assertTrue(track.getRawFixes().isEmpty());
|
||||
@@ -98,7 +99,7 @@ public class MarkPositionTimeFilterTest {
|
||||
when(trackedRace.getStartOfTracking()).thenReturn(start);
|
||||
when(trackedRace.getEndOfTracking()).thenReturn(end);
|
||||
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))), /* onlyWhenInTrackingInterval */ true);
|
||||
track.lockForRead();
|
||||
try {
|
||||
assertTrue(track.getRawFixes().isEmpty());
|
||||
@@ -107,7 +108,7 @@ public class MarkPositionTimeFilterTest {
|
||||
}
|
||||
when(trackedRace.getEndOfTracking()).thenReturn(fix.plus(10000));
|
||||
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
|
||||
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))), /* onlyWhenInTrackingInterval */ true);
|
||||
track.lockForRead();
|
||||
try {
|
||||
assertEquals(1, track.getRawFixes().size());
|
||||
|
||||
Reference in new issue
Block a user