From 4ad5c7b99c70989240816f425cc3fd4120be7244 Mon Sep 17 00:00:00 2001 From: cemturker Date: Wed, 18 Nov 2020 01:00:16 +0100 Subject: [PATCH] Fix TestService_ValidateAndSetDefaultsWithDNS test case --- core/service_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/service_test.go b/core/service_test.go index e08995e9..1f00996d 100644 --- a/core/service_test.go +++ b/core/service_test.go @@ -101,16 +101,18 @@ func TestService_ValidateAndSetDefaultsWithInvalidDNSQueryType(t *testing.T) { } func TestService_ValidateAndSetDefaultsWithDNS(t *testing.T) { + conditionSuccess := Condition("[DNS_RCODE] == NOERROR") service := &Service{ - Name: "", + Name: "dns-test", URL: "http://example.com", DNS: &DNS{ QueryType: "A", QueryName: "example.com", }, + Conditions: []*Condition{&conditionSuccess}, } service.ValidateAndSetDefaults() - if service.DNS.QueryName == "example.com." { + if service.DNS.QueryName != "example.com." { t.Error("Service.dns.query-name should be formatted with . suffix") } }