Fixes for migrator integration tests

This commit is contained in:
Trial97
2018-12-03 11:50:21 +02:00
committed by Dan Christian Bogos
parent cfb6b96abb
commit 6f8dc49831
3 changed files with 10 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ import (
"log"
"path"
"reflect"
"sort"
"testing"
"github.com/cgrates/cgrates/config"
@@ -150,8 +151,9 @@ func testTpResITCheckData(t *testing.T) {
if err != nil {
t.Error("Error when getting TpResources ", err.Error())
}
sort.Strings(result[0].ThresholdIDs)
if !reflect.DeepEqual(tpResources[0], result[0]) {
t.Errorf("Expecting: %+v, received: %+v", tpResources[0], result[0])
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(tpResources[0]), utils.ToJSON(result[0]))
}
result, err = tpResMigrator.storDBIn.StorDB().GetTPResources(
tpResources[0].TPid, tpResources[0].ID)

View File

@@ -24,6 +24,7 @@ import (
"log"
"path"
"reflect"
"sort"
"testing"
"github.com/cgrates/cgrates/config"
@@ -158,8 +159,9 @@ func testTpSplITCheckData(t *testing.T) {
if err != nil {
t.Error("Error when getting TpSuppliers ", err.Error())
}
sort.Strings(result[0].FilterIDs)
if !reflect.DeepEqual(tpSuppliers[0], result[0]) {
t.Errorf("Expecting: %+v, received: %+v", tpSuppliers[0], result[0])
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(tpSuppliers[0]), utils.ToJSON(result[0]))
}
result, err = tpSplMigrator.storDBIn.StorDB().GetTPSuppliers(
tpSuppliers[0].TPid, tpSuppliers[0].ID)

View File

@@ -24,6 +24,7 @@ import (
"log"
"path"
"reflect"
"sort"
"testing"
"github.com/cgrates/cgrates/config"
@@ -148,8 +149,10 @@ func testTpTresITCheckData(t *testing.T) {
if err != nil {
t.Error("Error when getting TpThresholds ", err.Error())
}
sort.Strings(result[0].FilterIDs)
sort.Strings(result[0].ActionIDs)
if !reflect.DeepEqual(tpThresholds[0], result[0]) {
t.Errorf("Expecting: %+v, received: %+v", tpThresholds[0], result[0])
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(tpThresholds[0]), utils.ToJSON(result[0]))
}
result, err = tpTresMigrator.storDBIn.StorDB().GetTPThresholds(
tpThresholds[0].TPid, tpThresholds[0].ID)