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:
parent
a1267f4bcc
commit
14ac4dfeca
1 changed files with 19 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue