MCPcopy
hub / github.com/elastic/go-elasticsearch / TestNew_AddressesAndCloudID_Error

Function TestNew_AddressesAndCloudID_Error

options_test.go:125–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

123}
124
125func TestNew_AddressesAndCloudID_Error(t *testing.T) {
126 t.Parallel()
127 _, err := New(
128 WithAddresses("http://localhost:8080"),
129 WithCloudID("foo:ABC="),
130 )
131 if err == nil {
132 t.Fatal("Expected error when both Addresses and CloudID are set")
133 }
134 match, _ := regexp.MatchString("both .* are set", err.Error())
135 if !match {
136 t.Errorf("Unexpected error message: %s", err)
137 }
138}
139
140func TestNew_InvalidCloudID(t *testing.T) {
141 t.Parallel()

Callers

nothing calls this directly

Calls 4

WithAddressesFunction · 0.85
WithCloudIDFunction · 0.85
NewFunction · 0.50
ErrorMethod · 0.45

Tested by

no test coverage detected