indices_open_test.go 571 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 TestIndicesOpenValidate(t *testing.T) {
  10. client := setupTestClient(t)
  11. // No index name -> fail with error
  12. res, err := NewIndicesOpenService(client).Do(context.TODO())
  13. if err == nil {
  14. t.Fatalf("expected IndicesOpen to fail without index name")
  15. }
  16. if res != nil {
  17. t.Fatalf("expected result to be == nil; got: %v", res)
  18. }
  19. }