refactor(go): default to go vehicle topics
This commit is contained in:
@@ -40,6 +40,23 @@ func TestNATSSinkRoutesRawAndUnifiedSubjects(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNATSSinkDefaultsToGoRawSubjects(t *testing.T) {
|
||||
publisher := &recordingNATSPublisher{}
|
||||
sink := newNATSSinkWithPublisher(publisher, NATSConfig{})
|
||||
|
||||
err := sink.PublishRaw(context.Background(), envelope.FrameEnvelope{
|
||||
Protocol: envelope.ProtocolJT808,
|
||||
Phone: "13307795425",
|
||||
ReceivedAtMS: 1782918600000,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("PublishRaw() error = %v", err)
|
||||
}
|
||||
if got, want := publisher.messages[0].subject, "vehicle.raw.go.jt808.v1"; got != want {
|
||||
t.Fatalf("subject = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
type recordingNATSPublisher struct {
|
||||
messages []recordedNATSMessage
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user