ExportImportTest: made tests deterministic.

Fixes #761.
This commit is contained in:
Dennis Guse
2021-07-14 18:53:41 +02:00
parent 7d24262b38
commit 65e920e8b6
4 changed files with 129 additions and 65 deletions
@@ -28,8 +28,8 @@ public class HandlerServer {
// Disabled to simplify testing and implementation of #822
// private ExecutorService serviceExecutor;
@VisibleForTesting
private Clock clock;
@NonNull
private Clock clock = Clock.systemUTC();
private final LocationHandler locationHandler;
private final EGM2008CorrectionManager egm2008CorrectionManager = new EGM2008CorrectionManager();
@@ -151,11 +151,7 @@ public class HandlerServer {
//TODO Limit visibility
public Instant createNow() {
if (clock != null) {
return Instant.now(clock);
} else {
return Instant.now();
}
return Instant.now(clock);
}
@Deprecated
@@ -170,6 +166,11 @@ public class HandlerServer {
this.remoteSensorManager = remoteSensorManager;
}
@VisibleForTesting
public void setClock(@NonNull Clock clock) {
this.clock = clock;
}
void sendGpsStatus(GpsStatusValue gpsStatusValue) {
service.newGpsStatus(gpsStatusValue);
}