diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-01-29 14:17:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 14:17:40 -0800 |
commit | 961c04cae992eadb42d286d2f85f8a675bdc68c8 (patch) | |
tree | 3408f2d06f847e966c53485e2d54c692cdd037c1 /vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go | |
parent | 8d66523ba7d9a77129844be476732ebfd5272d64 (diff) | |
download | chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.gz chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.tar.bz2 chat-961c04cae992eadb42d286d2f85f8a675bdc68c8.zip |
Upgrading server dependancies (#8154)
Diffstat (limited to 'vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go')
-rw-r--r-- | vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go b/vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go index ffac0d0f2..644e1187a 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go +++ b/vendor/gopkg.in/olivere/elastic.v5/indices_put_mapping_test.go @@ -19,18 +19,18 @@ func TestPutMappingURL(t *testing.T) { }{ { []string{}, - "tweet", - "/_mapping/tweet", + "doc", + "/_mapping/doc", }, { []string{"*"}, - "tweet", - "/%2A/_mapping/tweet", + "doc", + "/%2A/_mapping/doc", }, { []string{"store-1", "store-2"}, - "tweet", - "/store-1%2Cstore-2/_mapping/tweet", + "doc", + "/store-1%2Cstore-2/_mapping/doc", }, } @@ -47,9 +47,19 @@ func TestPutMappingURL(t *testing.T) { func TestMappingLifecycle(t *testing.T) { client := setupTestClientAndCreateIndex(t) + //client := setupTestClientAndCreateIndexAndLog(t) + + // Create index + createIndex, err := client.CreateIndex(testIndexName3).Do(context.TODO()) + if err != nil { + t.Fatal(err) + } + if createIndex == nil { + t.Errorf("expected result to be != nil; got: %v", createIndex) + } mapping := `{ - "tweetdoc":{ + "doc":{ "properties":{ "field":{ "type":"keyword" @@ -58,7 +68,7 @@ func TestMappingLifecycle(t *testing.T) { } }` - putresp, err := client.PutMapping().Index(testIndexName2).Type("tweetdoc").BodyString(mapping).Do(context.TODO()) + putresp, err := client.PutMapping().Index(testIndexName3).Type("doc").BodyString(mapping).Do(context.TODO()) if err != nil { t.Fatalf("expected put mapping to succeed; got: %v", err) } @@ -69,14 +79,14 @@ func TestMappingLifecycle(t *testing.T) { t.Fatalf("expected put mapping ack; got: %v", putresp.Acknowledged) } - getresp, err := client.GetMapping().Index(testIndexName2).Type("tweetdoc").Do(context.TODO()) + getresp, err := client.GetMapping().Index(testIndexName3).Type("doc").Do(context.TODO()) if err != nil { t.Fatalf("expected get mapping to succeed; got: %v", err) } if getresp == nil { t.Fatalf("expected get mapping response; got: %v", getresp) } - props, ok := getresp[testIndexName2] + props, ok := getresp[testIndexName3] if !ok { t.Fatalf("expected JSON root to be of type map[string]interface{}; got: %#v", props) } |