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