refactor(go): make raw topics the realtime source
This commit is contained in:
@@ -120,7 +120,6 @@ func TestLoadConfigDefaultsToGoSubjectRoutes(t *testing.T) {
|
||||
"vehicle.raw.go.gb32960.v1": "vehicle.raw.go.gb32960.v1",
|
||||
"vehicle.raw.go.jt808.v1": "vehicle.raw.go.jt808.v1",
|
||||
"vehicle.raw.go.yutong-mqtt.v1": "vehicle.raw.go.yutong-mqtt.v1",
|
||||
"vehicle.event.go.unified.v1": "vehicle.event.go.unified.v1",
|
||||
}
|
||||
if len(cfg.Route) != len(want) {
|
||||
t.Fatalf("route len = %d, want %d: %#v", len(cfg.Route), len(want), cfg.Route)
|
||||
@@ -132,6 +131,17 @@ func TestLoadConfigDefaultsToGoSubjectRoutes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadConfigIncludesUnifiedOnlyWhenExplicitlyConfigured(t *testing.T) {
|
||||
t.Setenv("NATS_SUBJECT_UNIFIED", "vehicle.event.go.unified.v1")
|
||||
t.Setenv("KAFKA_TOPIC_UNIFIED", "vehicle.event.go.unified.v1")
|
||||
|
||||
cfg := loadConfig()
|
||||
|
||||
if got := cfg.Route["vehicle.event.go.unified.v1"]; got != "vehicle.event.go.unified.v1" {
|
||||
t.Fatalf("unified route = %q, route=%#v", got, cfg.Route)
|
||||
}
|
||||
}
|
||||
|
||||
type recordingBridgeWriter struct {
|
||||
messages []kafka.Message
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user