mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 05:09:54 +05:00
Updated apier tests
This commit is contained in:
@@ -252,7 +252,6 @@ func testConcReqsOnBiJSONBusy(t *testing.T) {
|
||||
if err := concReqsBiRPC.Call(utils.SessionSv1Sleep,
|
||||
&DurationArgs{DurationTime: time.Duration(10 * time.Millisecond)},
|
||||
&resp); err != nil {
|
||||
fmt.Println(err)
|
||||
lock.Lock()
|
||||
failedAPIs++
|
||||
lock.Unlock()
|
||||
|
||||
@@ -202,7 +202,7 @@ func testV1RatePrfVerifyRateProfile(t *testing.T) {
|
||||
func testV1RatePrfRemoveRateProfile(t *testing.T) {
|
||||
var reply string
|
||||
if err := ratePrfRpc.Call(utils.APIerSv1RemoveRateProfile,
|
||||
utils.TenantIDWithArgDispatcher{TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "RP1"}}, &reply); err != nil {
|
||||
&utils.TenantIDWithCache{Tenant: "cgrates.org", ID: "RP1"}, &reply); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.OK, reply)
|
||||
|
||||
@@ -484,7 +484,7 @@ func testV1STSProcessMetricsWithFilter(t *testing.T) {
|
||||
Metrics: []*engine.MetricWithFilters{
|
||||
&engine.MetricWithFilters{
|
||||
MetricID: utils.MetaACD,
|
||||
FilterIDs: []string{"*rsr:~*req.Usage{*duration}:>10s"},
|
||||
FilterIDs: []string{"*gt:~*req.Usage:10s"},
|
||||
},
|
||||
&engine.MetricWithFilters{
|
||||
MetricID: utils.MetaTCD,
|
||||
|
||||
@@ -121,14 +121,15 @@ func testVrsRpcConn(t *testing.T) {
|
||||
func testVrsDataDB(t *testing.T) {
|
||||
var result engine.Versions
|
||||
expectedVrs := engine.Versions{"ActionTriggers": 2,
|
||||
"Actions": 2, "RQF": 4, "ReverseDestinations": 1, "Attributes": 5, "RatingPlan": 1,
|
||||
"RatingProfile": 1, "User": 1, "Accounts": 3, "ActionPlans": 3, "Chargers": 1,
|
||||
"Destinations": 1, "LoadIDs": 1, "SharedGroups": 2, "Stats": 2, "Resource": 1,
|
||||
"Subscribers": 1, "Routes": 1, "Thresholds": 3, "Timing": 1}
|
||||
"Actions": 2, "RQF": 5, "ReverseDestinations": 1, "Attributes": 6, "RatingPlan": 1,
|
||||
"RatingProfile": 1, "Accounts": 3, "ActionPlans": 3, "Chargers": 2,
|
||||
"Destinations": 1, "LoadIDs": 1, "SharedGroups": 2, "Stats": 4, "Resource": 1,
|
||||
"Subscribers": 1, "Routes": 2, "Thresholds": 4, "Timing": 1, "Dispatchers": 2,
|
||||
"RateProfiles": 1}
|
||||
if err := vrsRPC.Call(utils.APIerSv1GetDataDBVersions, utils.StringPointer(utils.EmptyString), &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if expectedVrs.Compare(result, vrsStorageType, true) != "" {
|
||||
t.Errorf("Expecting: %+v, received: %+v", expectedVrs, result)
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(expectedVrs), utils.ToJSON(result))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +143,7 @@ func testVrsStorDB(t *testing.T) {
|
||||
if err := vrsRPC.Call(utils.APIerSv1GetStorDBVersions, utils.StringPointer(utils.EmptyString), &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if expectedVrs.Compare(result, vrsStorageType, true) != "" {
|
||||
t.Errorf("Expecting: %+v, received: %+v", result, expectedVrs)
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(result), utils.ToJSON(expectedVrs))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,14 +162,15 @@ func testVrsSetDataDBVrs(t *testing.T) {
|
||||
|
||||
var result engine.Versions
|
||||
expectedVrs := engine.Versions{"ActionTriggers": 2,
|
||||
"Actions": 2, "RQF": 4, "ReverseDestinations": 1, "Attributes": 3, "RatingPlan": 1,
|
||||
"RatingProfile": 1, "User": 1, "Accounts": 3, "ActionPlans": 3, "Chargers": 1,
|
||||
"Destinations": 1, "LoadIDs": 1, "SharedGroups": 2, "Stats": 2, "Resource": 1,
|
||||
"Subscribers": 1, "Routes": 1, "Thresholds": 3, "Timing": 1}
|
||||
"Actions": 2, "RQF": 5, "ReverseDestinations": 1, "Attributes": 3, "RatingPlan": 1,
|
||||
"RatingProfile": 1, "Accounts": 3, "ActionPlans": 3, "Chargers": 2,
|
||||
"Destinations": 1, "LoadIDs": 1, "SharedGroups": 2, "Stats": 4, "Resource": 1,
|
||||
"Subscribers": 1, "Routes": 2, "Thresholds": 4, "Timing": 1,
|
||||
"RateProfiles": 1, "Dispatchers": 2}
|
||||
if err := vrsRPC.Call(utils.APIerSv1GetDataDBVersions, utils.StringPointer(utils.EmptyString), &result); err != nil {
|
||||
t.Error(err)
|
||||
} else if expectedVrs.Compare(result, vrsStorageType, true) != "" {
|
||||
t.Errorf("Expecting: %+v, received: %+v", expectedVrs, result)
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(expectedVrs), utils.ToJSON(result))
|
||||
}
|
||||
|
||||
args = SetVersionsArg{
|
||||
|
||||
Reference in New Issue
Block a user