Xapp-frame updated to v0.8.1.
[ric-plt/submgr.git] / pkg / control / ut_ctrl_submgr_test.go
index bc1435a..8f4e5ae 100644 (file)
@@ -46,6 +46,8 @@ type Counter struct {
        Value uint64
 }
 
+type CountersToBeAdded []Counter
+
 var countersBeforeMap map[string]Counter
 var toBeAddedCountersMap map[string]Counter
 
@@ -111,7 +113,7 @@ func PringSubscriptionQueryResult(resp models.SubscriptionList) {
        for _, item := range resp {
                fmt.Printf("item.SubscriptionID=%v\n", item.SubscriptionID)
                fmt.Printf("item.Meid=%v\n", item.Meid)
-               fmt.Printf("item.Endpoint=%v\n", item.Endpoint)
+               fmt.Printf("item.ClientEndpoint=%v\n", item.ClientEndpoint)
        }
 }
 
@@ -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) {