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") } }