From 5f51a59223d4c799fc8ff0712fc3f654a887ead4 Mon Sep 17 00:00:00 2001 From: fanhui Date: Tue, 6 Apr 2021 14:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/config/config_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/env/config/config_test.go b/env/config/config_test.go index 583d2f3..6db6f79 100644 --- a/env/config/config_test.go +++ b/env/config/config_test.go @@ -99,3 +99,22 @@ func TestSplitNamespaces(t *testing.T) { Assert(t, l, Equal(3)) w.Wait() } + +func TestNotificationsMap(t *testing.T) { + appConfig.Init() + ID := appConfig.GetNotificationsMap().GetNotify("application") + Assert(t, ID, Equal(int64(-1))) + + appConfig.GetNotificationsMap().UpdateNotify("application", 3) + newID := appConfig.GetNotificationsMap().GetNotify("application") + Assert(t, newID, Equal(int64(3))) + + appConfig.GetNotificationsMap().UpdateNotify("", 100) + noID := appConfig.GetNotificationsMap().GetNotify("") + Assert(t, noID, Equal(int64(0))) + + appConfig.GetNotificationsMap().UpdateNotify("noExistNS", 3) + noExistID := appConfig.GetNotificationsMap().GetNotify("noExistNs") + Assert(t, noExistID, Equal(int64(0))) + +}