From 8569cdc2a45ad9df0faf0cc5a99b59a74981dc0b Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Fri, 13 Nov 2020 15:36:48 +0200 Subject: [PATCH] Covered configsanity_test.go to 100% --- config/configsanity_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/configsanity_test.go b/config/configsanity_test.go index 765e2fc27..e30a1927a 100644 --- a/config/configsanity_test.go +++ b/config/configsanity_test.go @@ -853,6 +853,18 @@ func TestConfigSanityScheduler(t *testing.T) { t.Errorf("Expecting: %+q received: %+q", expected, err) } cfg.schedulerCfg.ThreshSConns = []string{} + + cfg.schedulerCfg.StatSConns = []string{utils.MetaInternal} + expected = " not enabled but requested by component." + if err := cfg.checkConfigSanity(); err == nil || err.Error() != expected { + t.Errorf("Expecting: %+q received: %+q", expected, err) + } + cfg.schedulerCfg.StatSConns = []string{"test"} + expected = " connection with id: not defined" + if err := cfg.checkConfigSanity(); err == nil || err.Error() != expected { + t.Errorf("Expecting: %+q received: %+q", expected, err) + } + cfg.schedulerCfg.StatSConns = []string{} } func TestConfigSanityEventReader(t *testing.T) {