refactor(go): remove source endpoint from realtime snapshots
This commit is contained in:
@@ -380,11 +380,12 @@ func TestHandlerReturnsMergedSnapshot(t *testing.T) {
|
||||
repo, closeFn := newTestRepository(t)
|
||||
defer closeFn()
|
||||
if err := repo.Update(context.Background(), envelope.FrameEnvelope{
|
||||
Protocol: envelope.ProtocolJT808,
|
||||
VIN: "VIN001",
|
||||
EventTimeMS: 1000,
|
||||
ReceivedAtMS: 1100,
|
||||
Fields: map[string]any{envelope.FieldSpeedKMH: 12.3},
|
||||
Protocol: envelope.ProtocolJT808,
|
||||
VIN: "VIN001",
|
||||
SourceEndpoint: "115.231.168.135:43625",
|
||||
EventTimeMS: 1000,
|
||||
ReceivedAtMS: 1100,
|
||||
Fields: map[string]any{envelope.FieldSpeedKMH: 12.3},
|
||||
}); err != nil {
|
||||
t.Fatalf("Update() error = %v", err)
|
||||
}
|
||||
@@ -398,6 +399,9 @@ func TestHandlerReturnsMergedSnapshot(t *testing.T) {
|
||||
if !stringsContains(rec.Body.String(), `"vin":"VIN001"`) {
|
||||
t.Fatalf("unexpected body: %s", rec.Body.String())
|
||||
}
|
||||
if stringsContains(rec.Body.String(), "source_endpoint") {
|
||||
t.Fatalf("realtime snapshot should not expose source_endpoint: %s", rec.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerReturnsPhoneOnlyVehicleKeySnapshot(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user