fix: preserve mileage metadata on location events
This commit is contained in:
@@ -42,6 +42,12 @@ class Gb32960EventMapperTest {
|
||||
assertThat(events).anyMatch(e -> e instanceof VehicleEvent.Location);
|
||||
assertThat(events).allMatch(e -> e.source() == ProtocolId.GB32960);
|
||||
assertThat(events).allMatch(e -> e.vin().equals("LTEST000000000002"));
|
||||
VehicleEvent.Location location = events.stream()
|
||||
.filter(VehicleEvent.Location.class::isInstance)
|
||||
.map(VehicleEvent.Location.class::cast)
|
||||
.findFirst()
|
||||
.orElseThrow();
|
||||
assertThat(location.metadata()).containsEntry("total_mileage_km", "123456.7");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user