X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fcontrol%2Fut_ctrl_submgr_test.go;h=009e70be52810642b5fa38df8fcab4ee49a9b20e;hb=refs%2Fchanges%2F50%2F5750%2F2;hp=bc1435a689b09fb27aa094fd630f29af60227d2b;hpb=4abf18056b1674fb284c4d7d753c35a3ddab37e4;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/ut_ctrl_submgr_test.go b/pkg/control/ut_ctrl_submgr_test.go index bc1435a..009e70b 100644 --- a/pkg/control/ut_ctrl_submgr_test.go +++ b/pkg/control/ut_ctrl_submgr_test.go @@ -46,6 +46,8 @@ type Counter struct { Value uint64 } +type CountersToBeAdded []Counter + var countersBeforeMap map[string]Counter var toBeAddedCountersMap map[string]Counter @@ -258,14 +260,15 @@ func (mc *testingSubmgrControl) GetMetrics(t *testing.T) (string, error) { return string(respBody[:]), nil } -func (mc *testingSubmgrControl) SetTimesCounterWillBeAdded(counterName string, addedValue uint64) { +func (mc *testingSubmgrControl) CounterValuesToBeVeriefied(t *testing.T, countersToBeAdded CountersToBeAdded) { + if len(toBeAddedCountersMap) == 0 { toBeAddedCountersMap = make(map[string]Counter) } - counter := Counter{} - counter.Name = counterName - counter.Value = addedValue - toBeAddedCountersMap[counterName] = counter + for _, counter := range countersToBeAdded { + toBeAddedCountersMap[counter.Name] = counter + } + mc.GetCounterValuesBefore(t) } func (mc *testingSubmgrControl) GetCounterValuesBefore(t *testing.T) {