From e1443b625c5ac754d6eec3ec6a894fddad8baedc Mon Sep 17 00:00:00 2001 From: TeoV Date: Mon, 26 Mar 2018 05:05:10 -0400 Subject: [PATCH] Update apier/v1 instegration test for stats and thresholds --- apier/v1/stats_it_test.go | 5 +++-- apier/v1/thresholds_it_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apier/v1/stats_it_test.go b/apier/v1/stats_it_test.go index b518b482e..478a77e32 100644 --- a/apier/v1/stats_it_test.go +++ b/apier/v1/stats_it_test.go @@ -147,10 +147,11 @@ func testV1STSFromFolder(t *testing.T) { func testV1STSGetStats(t *testing.T) { var reply []string - expectedIDs := []string{"Stats1"} + expectedIDs := []string{"Stats1", "Stats2"} + expectedIDs2 := []string{"Stats2", "Stats1"} if err := stsV1Rpc.Call(utils.StatSv1GetQueueIDs, "cgrates.org", &reply); err != nil { t.Error(err) - } else if !reflect.DeepEqual(expectedIDs, reply) { + } else if !reflect.DeepEqual(expectedIDs, reply) && !reflect.DeepEqual(expectedIDs2, reply) { t.Errorf("expecting: %+v, received reply: %s", expectedIDs, reply) } var metrics map[string]string diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index 2ca359146..fc243d299 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -233,7 +233,7 @@ func testV1TSFromFolder(t *testing.T) { func testV1TSGetThresholds(t *testing.T) { var tIDs []string - expectedIDs := []string{"THD_RES_1", "THD_STATS_2", "THD_STATS_1", "THD_ACNT_BALANCE_1", "THD_ACNT_EXPIRED", "THD_STATS_3", "THD_CDRS_1"} + expectedIDs := []string{"THD_RES_1", "THD_STATS_2", "THD_STATS_1", "THD_ACNT_BALANCE_1", "THD_ACNT_1011", "THD_ACNT_1012", "THD_ACNT_EXPIRED", "THD_STATS_3", "THD_CDRS_1"} if err := tSv1Rpc.Call(utils.ThresholdSv1GetThresholdIDs, "cgrates.org", &tIDs); err != nil { t.Error(err) } else if len(expectedIDs) != len(tIDs) { @@ -309,7 +309,7 @@ func testV1TSProcessEvent(t *testing.T) { func testV1TSGetThresholdsAfterProcess(t *testing.T) { var tIDs []string - expectedIDs := []string{"THD_RES_1", "THD_STATS_2", "THD_STATS_1", "THD_ACNT_BALANCE_1", "THD_ACNT_EXPIRED"} + expectedIDs := []string{"THD_RES_1", "THD_STATS_2", "THD_STATS_1", "THD_ACNT_1011", "THD_ACNT_1012", "THD_ACNT_BALANCE_1", "THD_ACNT_EXPIRED"} if err := tSv1Rpc.Call(utils.ThresholdSv1GetThresholdIDs, "cgrates.org", &tIDs); err != nil { t.Error(err) } else if len(expectedIDs) != len(tIDs) { // THD_STATS_3 is not reccurent, so it was removed