(t *testing.T)
| 3359 | } |
| 3360 | |
| 3361 | func 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 | } |
nothing calls this directly
no test coverage detected