(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func TestNew_CloudIDOverridesEnvironment(t *testing.T) { |
| 114 | t.Setenv("ELASTICSEARCH_URL", "http://example.com") |
| 115 | c, err := New(WithCloudID("foo:YmFyLmNsb3VkLmVzLmlvJGFiYzEyMyRkZWY0NTY=")) |
| 116 | if err != nil { |
| 117 | t.Fatalf("Unexpected error: %s", err) |
| 118 | } |
| 119 | u := c.Transport.(*elastictransport.Client).URLs()[0].String() |
| 120 | if u != "https://abc123.bar.cloud.es.io" { |
| 121 | t.Errorf("Unexpected URL, want=https://abc123.bar.cloud.es.io, got=%s", u) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func TestNew_AddressesAndCloudID_Error(t *testing.T) { |
| 126 | t.Parallel() |
nothing calls this directly
no test coverage detected