(t *testing.T)
| 797 | } |
| 798 | |
| 799 | func TestKeyValueDeleteStore(t *testing.T) { |
| 800 | s := RunBasicJetStreamServer() |
| 801 | defer shutdownJSServerAndRemoveStorage(t, s) |
| 802 | |
| 803 | nc, js := jsClient(t, s) |
| 804 | defer nc.Close() |
| 805 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 806 | defer cancel() |
| 807 | |
| 808 | _, err := js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: "WATCH"}) |
| 809 | expectOk(t, err) |
| 810 | |
| 811 | err = js.DeleteKeyValue(ctx, "WATCH") |
| 812 | expectOk(t, err) |
| 813 | |
| 814 | // delete again should fail |
| 815 | err = js.DeleteKeyValue(ctx, "WATCH") |
| 816 | expectErr(t, err, jetstream.ErrBucketNotFound) |
| 817 | |
| 818 | // check that we're backwards compatible |
| 819 | expectErr(t, err, jetstream.ErrStreamNotFound) |
| 820 | |
| 821 | _, err = js.KeyValue(ctx, "WATCH") |
| 822 | expectErr(t, err, jetstream.ErrBucketNotFound) |
| 823 | } |
| 824 | |
| 825 | func TestKeyValueDeleteVsPurge(t *testing.T) { |
| 826 | s := RunBasicJetStreamServer() |
nothing calls this directly
no test coverage detected