MCPcopy
hub / github.com/nats-io/nats.go / TestJetStreamStreamAndConsumerDescription

Function TestJetStreamStreamAndConsumerDescription

test/js_test.go:9235–9267  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9233}
9234
9235func TestJetStreamStreamAndConsumerDescription(t *testing.T) {
9236 s := RunBasicJetStreamServer()
9237 defer shutdownJSServerAndRemoveStorage(t, s)
9238
9239 nc, js := jsClient(t, s)
9240 defer nc.Close()
9241
9242 streamDesc := "stream description"
9243 si, err := js.AddStream(&nats.StreamConfig{
9244 Name: "TEST",
9245 Description: streamDesc,
9246 Subjects: []string{"foo"},
9247 })
9248 if err != nil {
9249 t.Fatalf("Error adding stream: %v", err)
9250 }
9251 if si.Config.Description != streamDesc {
9252 t.Fatalf("Invalid description: %q vs %q", streamDesc, si.Config.Description)
9253 }
9254
9255 consDesc := "consumer description"
9256 ci, err := js.AddConsumer("TEST", &nats.ConsumerConfig{
9257 Description: consDesc,
9258 Durable: "dur",
9259 DeliverSubject: "bar",
9260 })
9261 if err != nil {
9262 t.Fatalf("Error adding consumer: %v", err)
9263 }
9264 if ci.Config.Description != consDesc {
9265 t.Fatalf("Invalid description: %q vs %q", consDesc, ci.Config.Description)
9266 }
9267}
9268
9269func TestJetStreamMsgSubjectRewrite(t *testing.T) {
9270 s := RunBasicJetStreamServer()

Callers

nothing calls this directly

Calls 7

FatalfMethod · 0.80
RunBasicJetStreamServerFunction · 0.70
jsClientFunction · 0.70
AddStreamMethod · 0.65
AddConsumerMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected