From 570e909aaefaa4ad98b04a3f21f4050ed32b47ce Mon Sep 17 00:00:00 2001 From: andronache Date: Fri, 18 Dec 2020 16:58:30 +0200 Subject: [PATCH] Tests in services --- services/cores_it_test.go | 11 +++++++++++ services/stordb_it_test.go | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/services/cores_it_test.go b/services/cores_it_test.go index de95bff3a..e357467e3 100644 --- a/services/cores_it_test.go +++ b/services/cores_it_test.go @@ -74,5 +74,16 @@ func TestCoreSCoverage(t *testing.T) { if getCoreS == nil { t.Errorf("\nExpecting not ,\n Received <%+v>", getCoreS) } + //populates connChan with something in order to call the shutdown function + chS := engine.NewCacheS(cfg, nil, nil) + srv.connChan <- chS + srv.stopChan = make(chan struct{}) + getShut := srv.Shutdown() + if getShut != nil { + t.Errorf("\nExpecting not ,\n Received <%+v>", getShut) + } + if srv.IsRunning() { + t.Errorf("Expected service to be down") + } } diff --git a/services/stordb_it_test.go b/services/stordb_it_test.go index f9c06b14a..62fc94740 100644 --- a/services/stordb_it_test.go +++ b/services/stordb_it_test.go @@ -56,7 +56,7 @@ func TestStorDBServiceCoverage(t *testing.T) { Password: "test_pass", } err2 = srv.Reload() - if err2 != nil { + if err2 == nil { t.Errorf("\nExpecting ,\n Received <%+v>", err2) } }