TrackRecordingService: extract EGM2008CorrectionManager into HandlerServer.

Part of #882.
This commit is contained in:
Dennis Guse
2021-07-11 17:32:33 +02:00
parent f9d3108cb2
commit 1255ec8111
5 changed files with 27 additions and 25 deletions
@@ -39,7 +39,7 @@ public class HandlerServerTest {
@After
public void tearDown() {
subject.stop(context);
subject.stop();
}
@Test
@@ -58,7 +58,7 @@ public class HandlerServerTest {
int accuracy = 50;
// when
subject.sendTrackPoint(trackPoint, accuracy);
subject.onNewTrackPoint(trackPoint, accuracy);
// then
Thread.sleep(10); // Wait for executor service
@@ -60,7 +60,7 @@ public class LocationHandlerTest {
locationHandler.onLocationChanged(createLocation(45f, 35f, 3, 5, System.currentTimeMillis()));
// then
verify(handlerServer, times(1)).sendTrackPoint(any(TrackPoint.class), any(Integer.class));
verify(handlerServer, times(1)).onNewTrackPoint(any(TrackPoint.class), any(Integer.class));
}
/**
@@ -76,7 +76,7 @@ public class LocationHandlerTest {
locationHandler.onLocationChanged(createLocation(latitude, 35f, 3, 5, System.currentTimeMillis()));
// then
verify(handlerServer, times(0)).sendTrackPoint(any(TrackPoint.class), any(Integer.class));
verify(handlerServer, times(0)).onNewTrackPoint(any(TrackPoint.class), any(Integer.class));
}
/**
@@ -92,7 +92,7 @@ public class LocationHandlerTest {
// then
// no newTrackPoint called
verify(handlerServer, times(0)).sendTrackPoint(any(TrackPoint.class), any(Integer.class));
verify(handlerServer, times(0)).onNewTrackPoint(any(TrackPoint.class), any(Integer.class));
}
@Test
@@ -105,7 +105,7 @@ public class LocationHandlerTest {
locationHandler.onLocationChanged(createLocation(99.0, 35.0, Long.MAX_VALUE, 15, System.currentTimeMillis()));
// then
verify(handlerServer, times(1)).sendTrackPoint(any(TrackPoint.class), any(Integer.class));
verify(handlerServer, times(1)).onNewTrackPoint(any(TrackPoint.class), any(Integer.class));
}
/**