From 5d45c339a3771beecab9bb6f28530d5b9500259b Mon Sep 17 00:00:00 2001 From: TeoV Date: Mon, 23 Sep 2019 03:14:53 -0400 Subject: [PATCH] Add test for ApierV1.GetActionPlanIDs --- apier/v1/apier2_it_test.go | 14 ++++++++++++++ utils/consts.go | 1 + 2 files changed, 15 insertions(+) diff --git a/apier/v1/apier2_it_test.go b/apier/v1/apier2_it_test.go index b97e5077a..01a899a0c 100644 --- a/apier/v1/apier2_it_test.go +++ b/apier/v1/apier2_it_test.go @@ -57,6 +57,7 @@ var sTestsAPIer = []func(t *testing.T){ testAPIerGetRatingPlanCost, testAPIerGetRatingPlanCost2, testAPIerGetRatingPlanCost3, + testAPIerGetActionPlanIDs, testAPIerKillEngine, } @@ -270,6 +271,19 @@ func testAPIerGetRatingPlanCost3(t *testing.T) { } } +func testAPIerGetActionPlanIDs(t *testing.T) { + var reply []string + if err := apierRPC.Call(utils.ApierV1GetActionPlanIDs, + utils.TenantArgWithPaginator{TenantArg: utils.TenantArg{Tenant: "cgrates.org"}}, + &reply); err != nil { + t.Error(err) + } else if len(reply) != 1 { + t.Errorf("Expected: 1 , received: <%+v>", len(reply)) + }else if reply[0]!="AP_PACKAGE_10"{ + t.Errorf("Expected: AP_PACKAGE_10 , received: <%+v>", reply[0]) + } +} + func testAPIerKillEngine(t *testing.T) { if err := engine.KillEngine(*waitRater); err != nil { t.Error(err) diff --git a/utils/consts.go b/utils/consts.go index 1f2cd0f07..aa9c2bc53 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -810,6 +810,7 @@ const ( ApierV1SetStorDBVersions = "ApierV1.SetStorDBVersions" ApierV1GetAccountActionPlan = "ApierV1.GetAccountActionPlan" ApierV1ComputeActionPlanIndexes = "ApierV1.ComputeActionPlanIndexes" + ApierV1GetActionPlanIDs = "ApierV1.GetActionPlanIDs" ) const (