forked from upstream-mirrors/OpenTracks
Cleanup: Track simplify constructors.
This commit is contained in:
+1
-2
@@ -34,10 +34,9 @@ public class TrackFilenameGenerator2Test {
|
||||
@Test(expected = TrackFilenameGenerator.TemplateInvalidException.class)
|
||||
public void testFilenameTemplate() {
|
||||
// given
|
||||
Track track = new Track();
|
||||
Track track = new Track(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||
track.setName("Best Track");
|
||||
track.setUuid(UUID.fromString("f81d4fae-7dec-11d0-a765-00a0c91e6bf6"));
|
||||
track.setStatistics(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||
|
||||
// when
|
||||
subject.format(track, TrackFileFormat.GPX);
|
||||
|
||||
+1
-2
@@ -48,10 +48,9 @@ public class TrackFilenameGeneratorTest {
|
||||
@Test
|
||||
public void testFilenameTemplate() {
|
||||
// given
|
||||
Track track = new Track();
|
||||
Track track = new Track(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||
track.setName("Best Track");
|
||||
track.setUuid(UUID.fromString("0000fee0-0000-1000-8000-00805f9b34fb"));
|
||||
track.setStatistics(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||
|
||||
// when
|
||||
String filename = subject.format(track, TrackFileFormat.GPX);
|
||||
|
||||
+4
-4
@@ -99,9 +99,6 @@ public class IntervalStatisticsUpdaterTest {
|
||||
// given
|
||||
float distanceInterval = 1000f;
|
||||
int numberOfPoints = 10000;
|
||||
Track dummyTrack = new Track();
|
||||
dummyTrack.setId(new Track.Id(System.currentTimeMillis()));
|
||||
dummyTrack.setName("Dummy Track Without Elevation Loss");
|
||||
TrackStatisticsUpdater trackStatisticsUpdater = new TrackStatisticsUpdater();
|
||||
|
||||
ArrayList<TrackPoint> trackPoints = new ArrayList<>();
|
||||
@@ -110,7 +107,10 @@ public class IntervalStatisticsUpdaterTest {
|
||||
}
|
||||
trackStatisticsUpdater.addTrackPoints(trackPoints);
|
||||
|
||||
dummyTrack.setStatistics(trackStatisticsUpdater.getTrackStatistics());
|
||||
Track dummyTrack = new Track(trackStatisticsUpdater.getTrackStatistics());
|
||||
dummyTrack.setId(new Track.Id(System.currentTimeMillis()));
|
||||
dummyTrack.setName("Dummy Track Without Elevation Loss");
|
||||
|
||||
Pair<Track, List<TrackPoint>> trackWithStats = new Pair<>(dummyTrack, trackPoints);
|
||||
|
||||
// when and then
|
||||
|
||||
Reference in New Issue
Block a user