Update apier/v1 instegration test for stats and thresholds

This commit is contained in:
TeoV
2018-03-26 05:05:10 -04:00
committed by Dan Christian Bogos
parent c1badd578c
commit e1443b625c
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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