refactor(go): default to go vehicle topics

This commit is contained in:
lingniu
2026-07-02 20:22:47 +08:00
parent 3248336bea
commit 2ae9794dda
15 changed files with 130 additions and 27 deletions

View File

@@ -23,8 +23,8 @@ func TestKafkaSinkRoutesRawTopics(t *testing.T) {
t.Fatalf("messages = %d", len(writer.messages))
}
msg := writer.messages[0]
if msg.Topic != "vehicle.raw.jt808.v1" {
t.Fatalf("topic = %q", msg.Topic)
if got, want := msg.Topic, "vehicle.raw.go.jt808.v1"; got != want {
t.Fatalf("topic = %q, want %q", got, want)
}
if string(msg.Key) != "JT808:13307795425" {
t.Fatalf("key = %q", string(msg.Key))
@@ -82,7 +82,7 @@ func TestKafkaSinkPublishesDurableRecordsInSingleWriterCall(t *testing.T) {
if len(writer.messages) != 2 {
t.Fatalf("messages = %d, want 2", len(writer.messages))
}
if writer.messages[0].Topic != "vehicle.raw.jt808.v1" || writer.messages[1].Topic != "custom.unified" {
if writer.messages[0].Topic != "vehicle.raw.go.jt808.v1" || writer.messages[1].Topic != "custom.unified" {
t.Fatalf("topics = %q, %q", writer.messages[0].Topic, writer.messages[1].Topic)
}
}