mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-14 11:58:04 +00:00
add test for invalid port in config file
This commit is contained in:
parent
10310cf380
commit
4c151bdf8f
1 changed files with 17 additions and 0 deletions
|
@ -219,6 +219,23 @@ services:
|
|||
}
|
||||
}
|
||||
|
||||
func TestParseAndValidateConfigBytesWithInvalidPort(t *testing.T) {
|
||||
defer func() { recover() }()
|
||||
|
||||
parseAndValidateConfigBytes([]byte(`
|
||||
web:
|
||||
port: 65536
|
||||
address: 127.0.0.1
|
||||
services:
|
||||
- name: twinnation
|
||||
url: https://twinnation.org/actuator/health
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
`))
|
||||
|
||||
t.Fatal("Should've panicked because the configuration specifies an invalid port value")
|
||||
}
|
||||
|
||||
func TestParseAndValidateConfigBytesWithMetrics(t *testing.T) {
|
||||
config, err := parseAndValidateConfigBytes([]byte(`
|
||||
metrics: true
|
||||
|
|
Loading…
Reference in a new issue