mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
add test for invalid port in config file
This commit is contained in:
parent
10310cf380
commit
4c151bdf8f
@ -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 New Issue
Block a user