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

Function TestAccountInfo

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

Source from the content-addressed store, hash-verified

3359}
3360
3361func TestAccountInfo(t *testing.T) {
3362 tests := []struct {
3363 name string
3364 cfg string
3365 expected *nats.AccountInfo
3366 withError error
3367 }{
3368 {
3369 name: "server with default values",
3370 cfg: `
3371 listen: 127.0.0.1:-1
3372 jetstream: enabled
3373 `,
3374 expected: &nats.AccountInfo{
3375 Tier: nats.Tier{
3376 Memory: 0,
3377 Store: 0,
3378 Streams: 0,
3379 Consumers: 0,
3380 ReservedMemory: 0,
3381 ReservedStore: 0,
3382 Limits: nats.AccountLimits{
3383 MaxMemory: -1,
3384 MaxStore: -1,
3385 MaxStreams: -1,
3386 MaxConsumers: -1,
3387 MaxAckPending: -1,
3388 MemoryMaxStreamBytes: -1,
3389 StoreMaxStreamBytes: -1,
3390 MaxBytesRequired: false,
3391 },
3392 },
3393 API: nats.APIStats{
3394 Total: 0,
3395 Errors: 0,
3396 Level: server.JSApiLevel,
3397 Inflight: 0,
3398 },
3399 },
3400 },
3401 {
3402 name: "server with limits set",
3403 cfg: `
3404 listen: 127.0.0.1:-1
3405 jetstream: {domain: "test-domain"}
3406 accounts: {
3407 A {
3408 users: [{ user: "foo" }]
3409 jetstream: {
3410 max_mem: 64MB,
3411 max_file: 32MB,
3412 max_streams: 10,
3413 max_consumers: 20,
3414 max_ack_pending: 100,
3415 memory_max_stream_bytes: 2048,
3416 store_max_stream_bytes: 4096,
3417 max_stream_bytes: true
3418 }

Callers

nothing calls this directly

Calls 10

FatalfMethod · 0.80
createConfFileFunction · 0.70
RunServerWithConfigFunction · 0.70
jsClientFunction · 0.70
AccountInfoMethod · 0.65
AddStreamMethod · 0.65
AddConsumerMethod · 0.65
CloseMethod · 0.45
IsMethod · 0.45

Tested by

no test coverage detected