1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00

Add test for default parameters

This commit is contained in:
TwinProduction 2019-09-09 22:21:18 -04:00
parent a1267f4bcc
commit 14ac4dfeca

View file

@ -50,3 +50,22 @@ services:
t.Errorf("There should have been %d conditions", 2)
}
}
func TestParseConfigBytesDefault(t *testing.T) {
config := ParseConfigBytes([]byte(`
services:
- name: twinnation
url: https://twinnation.org/actuator/health
conditions:
- "$STATUS == 200"
`))
if config.Services[0].Url != "https://twinnation.org/actuator/health" {
t.Errorf("URL should have been %s", "https://twinnation.org/actuator/health")
}
if config.Services[0].Interval != 10*time.Second {
t.Errorf("Interval should have been %s, because it is the default value", 10*time.Second)
}
if config.Services[0].FailureThreshold != 1 {
t.Errorf("FailureThreshold should have been %d, because it is the default value", 1)
}
}