Fix TestService_ValidateAndSetDefaultsWithDNS test case
This commit is contained in:
parent
bc914e12b0
commit
4ad5c7b99c
@ -101,16 +101,18 @@ func TestService_ValidateAndSetDefaultsWithInvalidDNSQueryType(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestService_ValidateAndSetDefaultsWithDNS(t *testing.T) {
|
func TestService_ValidateAndSetDefaultsWithDNS(t *testing.T) {
|
||||||
|
conditionSuccess := Condition("[DNS_RCODE] == NOERROR")
|
||||||
service := &Service{
|
service := &Service{
|
||||||
Name: "",
|
Name: "dns-test",
|
||||||
URL: "http://example.com",
|
URL: "http://example.com",
|
||||||
DNS: &DNS{
|
DNS: &DNS{
|
||||||
QueryType: "A",
|
QueryType: "A",
|
||||||
QueryName: "example.com",
|
QueryName: "example.com",
|
||||||
},
|
},
|
||||||
|
Conditions: []*Condition{&conditionSuccess},
|
||||||
}
|
}
|
||||||
service.ValidateAndSetDefaults()
|
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")
|
t.Error("Service.dns.query-name should be formatted with . suffix")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user