Debian Codegraph @

indices_delete_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 (
8 "context"
9 "testing"
10 )
11
12 func TestIndicesDeleteValidate(t *testing.T) {
13 client := setupTestClient(t)
14
15 // No index name -> fail with error
16 res, err := NewIndicesDeleteService(client).Do(context.TODO())
17 if err == nil {
18 t.Fatalf("expected IndicesDelete to fail without index name")
19 }
20 if res != nil {
21 t.Fatalf("expected result to be == nil; got: %v", res)
22 }
23 }