indices_delete_test.go 577 B

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