Bluetooth sensors: event-driven TrackPoint creation.

Part of #500.
This commit is contained in:
Dennis Guse
2022-01-01 21:15:46 +01:00
parent 1fb8fc6a09
commit c4b8082efc
9 changed files with 40 additions and 27 deletions
@@ -62,7 +62,7 @@ public class GPSHandlerTest {
locationHandler.onLocationChanged(createLocation(45f, 35f, 3, 5, System.currentTimeMillis()));
// then
verify(trackPointCreator, times(1)).onNewTrackPoint(any(TrackPoint.class), any(Distance.class));
verify(trackPointCreator, times(1)).onNewTrackPoint(any(TrackPoint.class));
}
/**
@@ -78,7 +78,7 @@ public class GPSHandlerTest {
locationHandler.onLocationChanged(createLocation(latitude, 35f, 3, 5, System.currentTimeMillis()));
// then
verify(trackPointCreator, times(0)).onNewTrackPoint(any(TrackPoint.class), any(Distance.class));
verify(trackPointCreator, times(0)).onNewTrackPoint(any(TrackPoint.class));
}
/**
@@ -94,7 +94,7 @@ public class GPSHandlerTest {
// then
// no newTrackPoint called
verify(trackPointCreator, times(0)).onNewTrackPoint(any(TrackPoint.class), any(Distance.class));
verify(trackPointCreator, times(0)).onNewTrackPoint(any(TrackPoint.class));
}
@Test
@@ -107,7 +107,7 @@ public class GPSHandlerTest {
locationHandler.onLocationChanged(createLocation(99.0, 35.0, Long.MAX_VALUE, 15, System.currentTimeMillis()));
// then
verify(trackPointCreator, times(1)).onNewTrackPoint(any(TrackPoint.class), any(Distance.class));
verify(trackPointCreator, times(1)).onNewTrackPoint(any(TrackPoint.class));
}
/**