plugins_test.go 655 B

1234567891011121314151617181920212223242526272829303132
  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 "testing"
  6. func TestClientPlugins(t *testing.T) {
  7. client, err := NewClient()
  8. if err != nil {
  9. t.Fatal(err)
  10. }
  11. _, err = client.Plugins()
  12. if err != nil {
  13. t.Fatal(err)
  14. }
  15. }
  16. func TestClientHasPlugin(t *testing.T) {
  17. client, err := NewClient()
  18. if err != nil {
  19. t.Fatal(err)
  20. }
  21. found, err := client.HasPlugin("no-such-plugin")
  22. if err != nil {
  23. t.Fatal(err)
  24. }
  25. if found {
  26. t.Fatalf("expected to not find plugin %q", "no-such-plugin")
  27. }
  28. }