Debian Codegraph @

ingest_put_pipeline_test.go

raw
1 // Copyright 2012-present Oliver Eilhard. All rights reserved.
2 // Use of this source code is governed by a MIT-license.
3 // See http://olivere.mit-license.org/license.txt for details.
4
5 package elastic
6
7 import "testing"
8
9 func TestIngestPutPipelineURL(t *testing.T) {
10 client := setupTestClientAndCreateIndex(t)
11
12 tests := []struct {
13 Id string
14 Expected string
15 }{
16 {
17 "my-pipeline-id",
18 "/_ingest/pipeline/my-pipeline-id",
19 },
20 }
21
22 for _, test := range tests {
23 path, _, err := client.IngestPutPipeline(test.Id).buildURL()
24 if err != nil {
25 t.Fatal(err)
26 }
27 if path != test.Expected {
28 t.Errorf("expected %q; got: %q", test.Expected, path)
29 }
30 }
31 }