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

Function TestUserJWTAndSeed

test/nats_test.go:324–337  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

322}
323
324func TestUserJWTAndSeed(t *testing.T) {
325 if server.VERSION[0] == '1' {
326 t.Skip()
327 }
328 ts := runTrustServer()
329 defer ts.Shutdown()
330
331 url := fmt.Sprintf("nats://127.0.0.1:%d", TEST_PORT)
332 nc, err := nats.Connect(url, nats.UserJWTAndSeed(uJWT, string(uSeed)))
333 if err != nil {
334 t.Fatalf("Expected to connect, got %v", err)
335 }
336 nc.Close()
337}
338
339func TestUserCredentialBytes(t *testing.T) {
340 ts := runTrustServer()

Callers

nothing calls this directly

Calls 4

runTrustServerFunction · 0.85
ConnectMethod · 0.80
FatalfMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected