-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
cat_snapshots_test.go
24 lines (20 loc) · 759 Bytes
/
cat_snapshots_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
import (
"testing"
)
func TestCatSnapshots(t *testing.T) {
client := setupTestClientAndCreateIndexAndAddDocs(t, SetDecoder(&strictDecoder{})) // , SetTraceLog(log.New(os.Stdout, "", 0)))
urls, params, err := client.CatSnapshots().Repository("my_repo").Columns("*").buildURL()
if err != nil {
t.Fatal(err)
}
if want, have := "/_cat/snapshots/my_repo", urls; want != have {
t.Fatalf("want URL=%q, have %q", want, have)
}
if want, have := "format=json&h=%2A", params.Encode(); want != have {
t.Fatalf("want Params=%q, have %q", want, have)
}
}