diff --git a/registry/consul_registry_test.go b/registry/consul_registry_test.go index 7441a22c..fc51072a 100644 --- a/registry/consul_registry_test.go +++ b/registry/consul_registry_test.go @@ -104,7 +104,11 @@ func TestConsul_GetService_WithHealthyServiceNodes(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) } @@ -140,7 +144,11 @@ func TestConsul_GetService_WithUnhealthyServiceNode(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) } @@ -176,7 +184,11 @@ func TestConsul_GetService_WithUnhealthyServiceNodes(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) }