From aab16509164496f56bd575687d99b9d0f10dc64f Mon Sep 17 00:00:00 2001 From: TeoV Date: Thu, 11 Apr 2019 14:14:43 +0300 Subject: [PATCH] Fix Consistency problem between Rem and Remove* APIs --- apier/v1/accounts.go | 4 +- apier/v1/apier_it_test.go | 66 +++++++++++++------------- apier/v1/filter_indexes_it_test.go | 4 +- apier/v1/filterindexecache_it_test.go | 4 +- apier/v1/stats.go | 2 +- apier/v1/stats_it_test.go | 4 +- apier/v1/tpaccountactions.go | 2 +- apier/v1/tpaccountactions_it_test.go | 2 +- apier/v1/tpactionplans.go | 2 +- apier/v1/tpactionplans_it_test.go | 2 +- apier/v1/tpactions.go | 2 +- apier/v1/tpactions_it_test.go | 2 +- apier/v1/tpactiontriggers.go | 2 +- apier/v1/tpactiontriggers_it_test.go | 6 +-- apier/v1/tpattributes.go | 2 +- apier/v1/tpattributes_it_test.go | 2 +- apier/v1/tpchargers.go | 2 +- apier/v1/tpchargers_it_test.go | 2 +- apier/v1/tpdestinationrates.go | 2 +- apier/v1/tpdestinationrates_it_test.go | 2 +- apier/v1/tpdestinations.go | 2 +- apier/v1/tpdestinations_it_test.go | 6 +-- apier/v1/tpdispatchers.go | 8 ++-- apier/v1/tpdispatchers_it_test.go | 2 +- apier/v1/tpfilters.go | 2 +- apier/v1/tpfilters_it_test.go | 2 +- apier/v1/tprates.go | 2 +- apier/v1/tprates_it_test.go | 6 +-- apier/v1/tpratingplans.go | 2 +- apier/v1/tpratingplans_it_test.go | 6 +-- apier/v1/tpratingprofiles.go | 2 +- apier/v1/tpratingprofiles_it_test.go | 6 +-- apier/v1/tpresources.go | 2 +- apier/v1/tpresources_it_test.go | 6 +-- apier/v1/tpsharedgroups.go | 2 +- apier/v1/tpsharedgroups_it_test.go | 6 +-- apier/v1/tpstats.go | 2 +- apier/v1/tpstats_it_test.go | 6 +-- apier/v1/tpsuppliers.go | 2 +- apier/v1/tpsuppliers_it_test.go | 2 +- apier/v1/tpthresholds.go | 2 +- apier/v1/tpthresholds_it_test.go | 2 +- apier/v1/tptimings.go | 2 +- apier/v1/tptimings_it_test.go | 6 +-- apier/v2/tp_it_test.go | 8 ++-- apier/v2/tpdestinations.go | 2 +- console/statqueue_remove.go | 2 +- general_tests/a1_it_test.go | 4 +- 48 files changed, 109 insertions(+), 109 deletions(-) diff --git a/apier/v1/accounts.go b/apier/v1/accounts.go index bdb70b444..1dbce0df6 100644 --- a/apier/v1/accounts.go +++ b/apier/v1/accounts.go @@ -82,7 +82,7 @@ func (self *ApierV1) GetAccountActionPlan(attrs AttrAcntAction, reply *[]*Accoun return nil } -type AttrRemActionTiming struct { +type AttrRemoveActionTiming struct { ActionPlanId string // Id identifying the ActionTimings profile ActionTimingId string // Internal CGR id identifying particular ActionTiming, *all for all user related ActionTimings to be canceled Tenant string // Tenant the account belongs to @@ -91,7 +91,7 @@ type AttrRemActionTiming struct { } // Removes an ActionTimings or parts of it depending on filters being set -func (self *ApierV1) RemActionTiming(attrs AttrRemActionTiming, reply *string) (err error) { +func (self *ApierV1) RemoveActionTiming(attrs AttrRemoveActionTiming, reply *string) (err error) { if missing := utils.MissingStructFields(&attrs, []string{"ActionPlanId"}); len(missing) != 0 { // Only mandatory ActionPlanId return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go index ff070e461..b89648dd4 100644 --- a/apier/v1/apier_it_test.go +++ b/apier/v1/apier_it_test.go @@ -166,10 +166,10 @@ func TestApierTPTiming(t *testing.T) { t.Errorf("Calling ApierV1.GetTPTiming expected: %v, received: %v", tmAlways, rplyTmAlways2) } // Test remove - if err := rater.Call("ApierV1.RemTPTiming", AttrGetTPTiming{tmAlways2.TPid, tmAlways2.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPTiming, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPTiming", AttrGetTPTiming{tmAlways2.TPid, tmAlways2.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPTiming, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPTiming received: ", reply) + t.Error("Calling ApierV1.RemoveTPTiming received: ", reply) } // Test getIds var rplyTmIds []string @@ -217,10 +217,10 @@ func TestApierTPDestination(t *testing.T) { t.Errorf("Calling ApierV1.GetTPDestination expected: %v, received: %v", dstDe2, rplyDstDe2) } // Test remove - if err := rater.Call("ApierV1.RemTPDestination", AttrGetTPDestination{dstDe2.TPid, dstDe2.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPTiming, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPDestination", AttrGetTPDestination{dstDe2.TPid, dstDe2.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPTiming, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPTiming received: ", reply) + t.Error("Calling ApierV1.RemoveTPTiming received: ", reply) } // Test getIds var rplyDstIds []string @@ -268,10 +268,10 @@ func TestApierTPRate(t *testing.T) { t.Errorf("Calling ApierV1.GetTPRate expected: %+v, received: %+v", rt2, rplyRt2) } // Test remove - if err := rater.Call("ApierV1.RemTPRate", AttrGetTPRate{rt2.TPid, rt2.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPRate, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPRate", AttrGetTPRate{rt2.TPid, rt2.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPRate, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPRate received: ", reply) + t.Error("Calling ApierV1.RemoveTPRate received: ", reply) } // Test getIds var rplyRtIds []string @@ -322,10 +322,10 @@ func TestApierTPDestinationRate(t *testing.T) { t.Errorf("Calling ApierV1.GetTPDestinationRate expected: %v, received: %v", dr2, rplyDr2) } // Test remove - if err := rater.Call("ApierV1.RemTPDestinationRate", AttrGetTPDestinationRate{dr2.TPid, dr2.ID, utils.Paginator{}}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPRate, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPDestinationRate", AttrGetTPDestinationRate{dr2.TPid, dr2.ID, utils.Paginator{}}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPRate, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPRate received: ", reply) + t.Error("Calling ApierV1.RemoveTPRate received: ", reply) } // Test getIds var rplyDrIds []string @@ -373,10 +373,10 @@ func TestApierTPRatingPlan(t *testing.T) { t.Errorf("Calling ApierV1.GetTPRatingPlan expected: %v, received: %v", rpTst, rplyRpTst) } // Test remove - if err := rater.Call("ApierV1.RemTPRatingPlan", AttrGetTPRatingPlan{TPid: rpTst.TPid, ID: rpTst.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPRatingPlan, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPRatingPlan", AttrGetTPRatingPlan{TPid: rpTst.TPid, ID: rpTst.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPRatingPlan, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPRatingPlan received: ", reply) + t.Error("Calling ApierV1.RemoveTPRatingPlan received: ", reply) } // Test getIds var rplyRpIds []string @@ -426,10 +426,10 @@ func TestApierTPRatingProfile(t *testing.T) { t.Errorf("Calling ApierV1.GetTPRatingProfiles expected: %v, received: %v", rpfTst, rplyRpf) } // Test remove - if err := rater.Call("ApierV1.RemTPRatingProfile", AttrGetTPRatingProfile{TPid: rpfTst.TPid, RatingProfileId: rpfTst.GetRatingProfilesId()}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPRatingProfile, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPRatingProfile", AttrGetTPRatingProfile{TPid: rpfTst.TPid, RatingProfileId: rpfTst.GetRatingProfilesId()}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPRatingProfile, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPRatingProfile received: ", reply) + t.Error("Calling ApierV1.RemoveTPRatingProfile received: ", reply) } // Test getLoadIds var rplyRpIds []string @@ -485,10 +485,10 @@ func TestApierTPActions(t *testing.T) { t.Errorf("Calling ApierV1.GetTPActions expected: %v, received: %v", actTst, rplyActs) } // Test remove - if err := rater.Call("ApierV1.RemTPActions", AttrGetTPActions{TPid: actTst.TPid, ID: actTst.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPActions, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPActions", AttrGetTPActions{TPid: actTst.TPid, ID: actTst.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPActions, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPActions received: ", reply) + t.Error("Calling ApierV1.RemoveTPActions received: ", reply) } // Test getIds var rplyIds []string @@ -535,10 +535,10 @@ func TestApierTPActionPlan(t *testing.T) { t.Errorf("Calling ApierV1.GetTPActionPlan expected: %v, received: %v", atTst, rplyActs) } // Test remove - if err := rater.Call("ApierV1.RemTPActionPlan", AttrGetTPActionPlan{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPActionPlan, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPActionPlan", AttrGetTPActionPlan{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPActionPlan, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPActionPlan received: ", reply) + t.Error("Calling ApierV1.RemoveTPActionPlan received: ", reply) } // Test getIds var rplyIds []string @@ -591,10 +591,10 @@ func TestApierTPActionTriggers(t *testing.T) { t.Errorf("Calling ApierV1.GetTPActionTriggers expected: %+v, received: %+v", atTst.ActionTriggers[0], rplyActs.ActionTriggers[0]) } // Test remove - if err := rater.Call("ApierV1.RemTPActionTriggers", AttrGetTPActionTriggers{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPActionTriggers, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPActionTriggers", AttrGetTPActionTriggers{TPid: atTst.TPid, ID: atTst.ID}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPActionTriggers, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPActionTriggers received: ", reply) + t.Error("Calling ApierV1.RemoveTPActionTriggers received: ", reply) } // Test getIds var rplyIds []string @@ -649,10 +649,10 @@ func TestApierTPAccountActions(t *testing.T) { t.Errorf("Calling ApierV1.GetTPAccountActions expected: %v, received: %v", aaTst, rplyaa) } // Test remove - if err := rater.Call("ApierV1.RemTPAccountActions", AttrGetTPAccountActions{TPid: aaTst.TPid, AccountActionsId: aaTst.GetId()}, &reply); err != nil { - t.Error("Calling ApierV1.RemTPAccountActions, got error: ", err.Error()) + if err := rater.Call("ApierV1.RemoveTPAccountActions", AttrGetTPAccountActions{TPid: aaTst.TPid, AccountActionsId: aaTst.GetId()}, &reply); err != nil { + t.Error("Calling ApierV1.RemoveTPAccountActions, got error: ", err.Error()) } else if reply != "OK" { - t.Error("Calling ApierV1.RemTPAccountActions received: ", reply) + t.Error("Calling ApierV1.RemoveTPAccountActions received: ", reply) } // Test getLoadIds var rplyRpIds []string @@ -1176,9 +1176,9 @@ func TestApierITGetScheduledActionsForAccount(t *testing.T) { // Test here RemoveActionTiming func TestApierRemUniqueIDActionTiming(t *testing.T) { var rmReply string - rmReq := AttrRemActionTiming{ActionPlanId: "ATMS_1", Tenant: "cgrates.org", Account: "dan4"} - if err := rater.Call("ApierV1.RemActionTiming", rmReq, &rmReply); err != nil { - t.Error("Got error on ApierV1.RemActionTiming: ", err.Error()) + rmReq := AttrRemoveActionTiming{ActionPlanId: "ATMS_1", Tenant: "cgrates.org", Account: "dan4"} + if err := rater.Call("ApierV1.RemoveActionTiming", rmReq, &rmReply); err != nil { + t.Error("Got error on ApierV1.RemoveActionTiming: ", err.Error()) } else if rmReply != OK { t.Error("Unexpected answer received", rmReply) } diff --git a/apier/v1/filter_indexes_it_test.go b/apier/v1/filter_indexes_it_test.go index 7aaf1090d..e34e90f23 100644 --- a/apier/v1/filter_indexes_it_test.go +++ b/apier/v1/filter_indexes_it_test.go @@ -666,13 +666,13 @@ func testV1FIdxRemoveStatQueueProfile(t *testing.T) { if result != utils.OK { t.Errorf("Error: %+v", result) } - if err := tFIdxRpc.Call("ApierV1.RemStatQueueProfile", + if err := tFIdxRpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &result); err != nil { t.Error(err) } else if result != utils.OK { t.Error("Unexpected reply returned", result) } - if err := tFIdxRpc.Call("ApierV1.RemStatQueueProfile", + if err := tFIdxRpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &result); err != nil { t.Error(err) } else if result != utils.OK { diff --git a/apier/v1/filterindexecache_it_test.go b/apier/v1/filterindexecache_it_test.go index 7e7054fba..a6b1f6d1b 100644 --- a/apier/v1/filterindexecache_it_test.go +++ b/apier/v1/filterindexecache_it_test.go @@ -791,7 +791,7 @@ func testV1FIdxCaRemoveStatQueueProfile(t *testing.T) { } var result string //Remove threshold profile that was set form api - if err := tFIdxCaRpc.Call("ApierV1.RemStatQueueProfile", + if err := tFIdxCaRpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &result); err != nil { t.Error(err) } else if result != utils.OK { @@ -805,7 +805,7 @@ func testV1FIdxCaRemoveStatQueueProfile(t *testing.T) { t.Error(err) } //Remove threshold profile that was set form tariffplan - if err := tFIdxCaRpc.Call("ApierV1.RemStatQueueProfile", + if err := tFIdxCaRpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "Stats1"}, &result); err != nil { t.Error(err) } else if result != utils.OK { diff --git a/apier/v1/stats.go b/apier/v1/stats.go index 8962b26c1..98a0eeeef 100644 --- a/apier/v1/stats.go +++ b/apier/v1/stats.go @@ -110,7 +110,7 @@ func (apierV1 *ApierV1) SetStatQueueProfile(arg *StatQueueWithCache, reply *stri } // Remove a specific stat configuration -func (apierV1 *ApierV1) RemStatQueueProfile(args *utils.TenantIDWithCache, reply *string) error { +func (apierV1 *ApierV1) RemoveStatQueueProfile(args *utils.TenantIDWithCache, reply *string) error { if missing := utils.MissingStructFields(args, []string{"Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/stats_it_test.go b/apier/v1/stats_it_test.go index 678d75d79..fb2702395 100644 --- a/apier/v1/stats_it_test.go +++ b/apier/v1/stats_it_test.go @@ -402,7 +402,7 @@ func testV1STSUpdateStatQueueProfile(t *testing.T) { func testV1STSRemoveStatQueueProfile(t *testing.T) { var resp string - if err := stsV1Rpc.Call("ApierV1.RemStatQueueProfile", + if err := stsV1Rpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { @@ -413,7 +413,7 @@ func testV1STSRemoveStatQueueProfile(t *testing.T) { &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &sqp); err == nil || err.Error() != utils.ErrNotFound.Error() { t.Error(err) } - if err := stsV1Rpc.Call("ApierV1.RemStatQueueProfile", + if err := stsV1Rpc.Call("ApierV1.RemoveStatQueueProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err.Error() != utils.ErrNotFound.Error() { t.Errorf("Expected error: %v recived: %v", utils.ErrNotFound, err) } diff --git a/apier/v1/tpaccountactions.go b/apier/v1/tpaccountactions.go index 341453b7f..51c70e78c 100644 --- a/apier/v1/tpaccountactions.go +++ b/apier/v1/tpaccountactions.go @@ -126,7 +126,7 @@ func (self *ApierV1) GetTPAccountActionIds(attrs AttrGetTPAccountActionIds, repl } // Removes specific AccountActions on Tariff plan -func (self *ApierV1) RemTPAccountActions(attrs AttrGetTPAccountActions, reply *string) error { +func (self *ApierV1) RemoveTPAccountActions(attrs AttrGetTPAccountActions, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "LoadId", "Tenant", "Account"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpaccountactions_it_test.go b/apier/v1/tpaccountactions_it_test.go index d7547d08f..ce96d83d5 100644 --- a/apier/v1/tpaccountactions_it_test.go +++ b/apier/v1/tpaccountactions_it_test.go @@ -213,7 +213,7 @@ func testTPAccActionsGetTPAccActionAfterUpdate(t *testing.T) { func testTPAccActionsRemTPAccAction(t *testing.T) { var resp string - if err := tpAccActionsRPC.Call("ApierV1.RemTPAccountActions", + if err := tpAccActionsRPC.Call("ApierV1.RemoveTPAccountActions", &AttrGetTPAccountActions{TPid: "TPAcc", AccountActionsId: tpAccActionID}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpactionplans.go b/apier/v1/tpactionplans.go index 5f63470f6..8b732cbc3 100644 --- a/apier/v1/tpactionplans.go +++ b/apier/v1/tpactionplans.go @@ -85,7 +85,7 @@ func (self *ApierV1) GetTPActionPlanIds(attrs AttrGetTPActionPlanIds, reply *[]s } // Removes specific ActionPlan on Tariff plan -func (self *ApierV1) RemTPActionPlan(attrs AttrGetTPActionPlan, reply *string) error { +func (self *ApierV1) RemoveTPActionPlan(attrs AttrGetTPActionPlan, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpactionplans_it_test.go b/apier/v1/tpactionplans_it_test.go index 689292f4e..f95a01a8f 100644 --- a/apier/v1/tpactionplans_it_test.go +++ b/apier/v1/tpactionplans_it_test.go @@ -224,7 +224,7 @@ func testTPAccPlansGetTPAccPlanAfterUpdate(t *testing.T) { func testTPAccPlansRemTPAccPlan(t *testing.T) { var resp string - if err := tpAccPlansRPC.Call("ApierV1.RemTPActionPlan", + if err := tpAccPlansRPC.Call("ApierV1.RemoveTPActionPlan", &AttrGetTPActionPlan{TPid: "TPAcc", ID: "ID"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpactions.go b/apier/v1/tpactions.go index d6edd3a30..0859c0350 100644 --- a/apier/v1/tpactions.go +++ b/apier/v1/tpactions.go @@ -77,7 +77,7 @@ func (self *ApierV1) GetTPActionIds(attrs AttrGetTPActionIds, reply *[]string) e } // Removes specific Actions on Tariff plan -func (self *ApierV1) RemTPActions(attrs AttrGetTPActions, reply *string) error { +func (self *ApierV1) RemoveTPActions(attrs AttrGetTPActions, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpactions_it_test.go b/apier/v1/tpactions_it_test.go index bc0c44d2f..e0e2d93ee 100644 --- a/apier/v1/tpactions_it_test.go +++ b/apier/v1/tpactions_it_test.go @@ -293,7 +293,7 @@ func testTPActionsGetTPActionAfterUpdate(t *testing.T) { func testTPActionsRemTPAction(t *testing.T) { var resp string - if err := tpActionRPC.Call("ApierV1.RemTPActions", + if err := tpActionRPC.Call("ApierV1.RemoveTPActions", &AttrGetTPActions{TPid: "TPAcc", ID: "ID"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpactiontriggers.go b/apier/v1/tpactiontriggers.go index 942040b04..ae6a00d4e 100644 --- a/apier/v1/tpactiontriggers.go +++ b/apier/v1/tpactiontriggers.go @@ -77,7 +77,7 @@ func (self *ApierV1) GetTPActionTriggerIds(attrs AttrGetTPActionTriggerIds, repl } // Removes specific ActionTriggers on Tariff plan -func (self *ApierV1) RemTPActionTriggers(attrs AttrGetTPActionTriggers, reply *string) error { +func (self *ApierV1) RemoveTPActionTriggers(attrs AttrGetTPActionTriggers, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpactiontriggers_it_test.go b/apier/v1/tpactiontriggers_it_test.go index 6b8076e98..3fed4ab0e 100644 --- a/apier/v1/tpactiontriggers_it_test.go +++ b/apier/v1/tpactiontriggers_it_test.go @@ -54,7 +54,7 @@ var sTestsTPActionTriggers = []func(t *testing.T){ testTPActionTriggersGetTPActionTriggersIds, testTPActionTriggersUpdateTPActionTriggers, testTPActionTriggersGetTPActionTriggersAfterUpdate, - testTPActionTriggersRemTPActionTriggers, + testTPActionTriggersRemoveTPActionTriggers, testTPActionTriggersGetTPActionTriggersAfterRemove, testTPActionTriggersKillEngine, } @@ -312,9 +312,9 @@ func testTPActionTriggersGetTPActionTriggersAfterUpdate(t *testing.T) { } -func testTPActionTriggersRemTPActionTriggers(t *testing.T) { +func testTPActionTriggersRemoveTPActionTriggers(t *testing.T) { var resp string - if err := tpActionTriggerRPC.Call("ApierV1.RemTPActionTriggers", + if err := tpActionTriggerRPC.Call("ApierV1.RemoveTPActionTriggers", &AttrGetTPActionTriggers{TPid: "TPAct", ID: "ID"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpattributes.go b/apier/v1/tpattributes.go index 7a415af7c..06faf56e8 100644 --- a/apier/v1/tpattributes.go +++ b/apier/v1/tpattributes.go @@ -71,7 +71,7 @@ func (self *ApierV1) GetTPAttributeProfileIds(attrs *AttrGetTPAttributeProfileId } // Removes specific AttributeProfile on Tariff plan -func (self *ApierV1) RemTPAttributeProfile(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPAttributeProfile(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpattributes_it_test.go b/apier/v1/tpattributes_it_test.go index 5b1deb99e..2f8995822 100644 --- a/apier/v1/tpattributes_it_test.go +++ b/apier/v1/tpattributes_it_test.go @@ -236,7 +236,7 @@ func testTPAlsPrfGetTPAlsPrfAfterUpdate(t *testing.T) { func testTPAlsPrfRemTPAlsPrf(t *testing.T) { var resp string - if err := tpAlsPrfRPC.Call("ApierV1.RemTPAttributeProfile", + if err := tpAlsPrfRPC.Call("ApierV1.RemoveTPAttributeProfile", &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "Attr1"}, &resp); err != nil { t.Error(err) diff --git a/apier/v1/tpchargers.go b/apier/v1/tpchargers.go index 968f2c7cc..2b038ae3b 100755 --- a/apier/v1/tpchargers.go +++ b/apier/v1/tpchargers.go @@ -73,7 +73,7 @@ func (self *ApierV1) GetTPChargerIDs(attrs *AttrGetTPChargerIds, reply *[]string } // Removes specific ChargerProfile on Tariff plan -func (self *ApierV1) RemTPCharger(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPCharger(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpchargers_it_test.go b/apier/v1/tpchargers_it_test.go index c58e2ade5..910751118 100644 --- a/apier/v1/tpchargers_it_test.go +++ b/apier/v1/tpchargers_it_test.go @@ -192,7 +192,7 @@ func testTPChrgsGetTPChrgsAfterUpdate(t *testing.T) { func testTPChrgsRemTPChrgs(t *testing.T) { var resp string - if err := tpChrgsRPC.Call("ApierV1.RemTPCharger", + if err := tpChrgsRPC.Call("ApierV1.RemoveTPCharger", &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "Chrgs"}, &resp); err != nil { t.Error(err) diff --git a/apier/v1/tpdestinationrates.go b/apier/v1/tpdestinationrates.go index 1364fd508..0ac5d3d0f 100644 --- a/apier/v1/tpdestinationrates.go +++ b/apier/v1/tpdestinationrates.go @@ -80,7 +80,7 @@ func (self *ApierV1) GetTPDestinationRateIds(attrs AttrGetTPRateIds, reply *[]st } // Removes specific DestinationRate on Tariff plan -func (self *ApierV1) RemTPDestinationRate(attrs AttrGetTPDestinationRate, reply *string) error { +func (self *ApierV1) RemoveTPDestinationRate(attrs AttrGetTPDestinationRate, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpdestinationrates_it_test.go b/apier/v1/tpdestinationrates_it_test.go index dbf91f78b..5c6c96bfa 100644 --- a/apier/v1/tpdestinationrates_it_test.go +++ b/apier/v1/tpdestinationrates_it_test.go @@ -183,7 +183,7 @@ func testTPDstRateGetTPDstRateAfterUpdate(t *testing.T) { func testTPDstRateRemTPDstRate(t *testing.T) { var resp string - if err := tpDstRateRPC.Call("ApierV1.RemTPDestinationRate", + if err := tpDstRateRPC.Call("ApierV1.RemoveTPDestinationRate", &AttrGetTPDestinationRate{TPid: "TP1", ID: "DR_FREESWITCH_USERS"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpdestinations.go b/apier/v1/tpdestinations.go index ae26d4d21..fcf175908 100644 --- a/apier/v1/tpdestinations.go +++ b/apier/v1/tpdestinations.go @@ -77,7 +77,7 @@ func (self *ApierV1) GetTPDestinationIDs(attrs AttrGetTPDestinationIds, reply *[ } // Removes specific Destination on Tariff plan -func (self *ApierV1) RemTPDestination(attrs AttrGetTPDestination, reply *string) error { +func (self *ApierV1) RemoveTPDestination(attrs AttrGetTPDestination, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpdestinations_it_test.go b/apier/v1/tpdestinations_it_test.go index 4deb110c6..70434045b 100644 --- a/apier/v1/tpdestinations_it_test.go +++ b/apier/v1/tpdestinations_it_test.go @@ -53,7 +53,7 @@ var sTestsTPDestinations = []func(t *testing.T){ testTPDestinationsGetTPDestinationIds, testTPDestinationsUpdateTPDestination, testTPDestinationsGetTPDestinationAfterUpdate, - testTPDestinationsRemTPDestination, + testTPDestinationsRemoveTPDestination, testTPDestinationsGetTPDestinationAfterRemove, testTPDestinationsKillEngine, } @@ -196,9 +196,9 @@ func testTPDestinationsGetTPDestinationAfterUpdate(t *testing.T) { } -func testTPDestinationsRemTPDestination(t *testing.T) { +func testTPDestinationsRemoveTPDestination(t *testing.T) { var resp string - if err := tpDestinationRPC.Call("ApierV1.RemTPDestination", + if err := tpDestinationRPC.Call("ApierV1.RemoveTPDestination", &AttrGetTPDestination{TPid: "TPD", ID: "GERMANY"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpdispatchers.go b/apier/v1/tpdispatchers.go index 0ddd76229..ea1f29da4 100644 --- a/apier/v1/tpdispatchers.go +++ b/apier/v1/tpdispatchers.go @@ -72,8 +72,8 @@ func (self *ApierV1) GetTPDispatcherProfileIDs(attrs *AttrGetTPDispatcherIds, re return nil } -//RemTPCharger removes specific DispatcherProfile on Tariff plan -func (self *ApierV1) RemTPDispatcherProfile(attrs *utils.TPTntID, reply *string) error { +//RemoveTPCharger removes specific DispatcherProfile on Tariff plan +func (self *ApierV1) RemoveTPDispatcherProfile(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } @@ -131,8 +131,8 @@ func (self *ApierV1) GetTPDispatcherHostIDs(attrs *AttrGetTPDispatcherIds, reply return nil } -//RemTPDispatcherHost removes specific DispatcherHost on Tariff plan -func (self *ApierV1) RemTPDispatcherHost(attrs *utils.TPTntID, reply *string) error { +//RemoveTPDispatcherHost removes specific DispatcherHost on Tariff plan +func (self *ApierV1) RemoveTPDispatcherHost(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpdispatchers_it_test.go b/apier/v1/tpdispatchers_it_test.go index d0789fb8b..38692e6fd 100644 --- a/apier/v1/tpdispatchers_it_test.go +++ b/apier/v1/tpdispatchers_it_test.go @@ -194,7 +194,7 @@ func testTPDispatcherGetTPDispatcherAfterUpdate(t *testing.T) { func testTPDispatcherRemTPDispatcher(t *testing.T) { var resp string - if err := tpDispatcherRPC.Call("ApierV1.RemTPDispatcherProfile", + if err := tpDispatcherRPC.Call("ApierV1.RemoveTPDispatcherProfile", &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "Dsp1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpfilters.go b/apier/v1/tpfilters.go index 595d08f99..27f6a76b7 100644 --- a/apier/v1/tpfilters.go +++ b/apier/v1/tpfilters.go @@ -73,7 +73,7 @@ func (self *ApierV1) GetTPFilterProfileIds(attrs *AttrGetTPFilterProfileIds, rep } // Removes specific FilterProfile on Tariff plan -func (self *ApierV1) RemTPFilterProfile(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPFilterProfile(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpfilters_it_test.go b/apier/v1/tpfilters_it_test.go index bfe36635d..6a766c93a 100644 --- a/apier/v1/tpfilters_it_test.go +++ b/apier/v1/tpfilters_it_test.go @@ -221,7 +221,7 @@ func testTPFilterGetTPFilterAfterUpdate(t *testing.T) { func testTPFilterRemTPFilter(t *testing.T) { var resp string - if err := tpFilterRPC.Call("ApierV1.RemTPFilterProfile", + if err := tpFilterRPC.Call("ApierV1.RemoveTPFilterProfile", &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "Filter"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tprates.go b/apier/v1/tprates.go index 26fb2e9cd..1694f45ee 100644 --- a/apier/v1/tprates.go +++ b/apier/v1/tprates.go @@ -79,7 +79,7 @@ func (self *ApierV1) GetTPRateIds(attrs AttrGetTPRateIds, reply *[]string) error } // Removes specific Rate on Tariff plan -func (self *ApierV1) RemTPRate(attrs AttrGetTPRate, reply *string) error { +func (self *ApierV1) RemoveTPRate(attrs AttrGetTPRate, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tprates_it_test.go b/apier/v1/tprates_it_test.go index 88d8d2a1c..c38a376ef 100644 --- a/apier/v1/tprates_it_test.go +++ b/apier/v1/tprates_it_test.go @@ -53,7 +53,7 @@ var sTestsTPRates = []func(t *testing.T){ testTPRatesGetTPRateIds, testTPRatesUpdateTPRate, testTPRatesGetTPRateAfterUpdate, - testTPRatesRemTPRate, + testTPRatesRemoveTPRate, testTPRatesGetTPRateAfterRemove, testTPRatesKillEngine, } @@ -219,9 +219,9 @@ func testTPRatesGetTPRateAfterUpdate(t *testing.T) { } -func testTPRatesRemTPRate(t *testing.T) { +func testTPRatesRemoveTPRate(t *testing.T) { var resp string - if err := tpRateRPC.Call("ApierV1.RemTPRate", + if err := tpRateRPC.Call("ApierV1.RemoveTPRate", &AttrGetTPRate{TPid: "TPidTpRate", ID: "RT_FS_USERS"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpratingplans.go b/apier/v1/tpratingplans.go index ee76b3198..e5c0bd69e 100644 --- a/apier/v1/tpratingplans.go +++ b/apier/v1/tpratingplans.go @@ -80,7 +80,7 @@ func (self *ApierV1) GetTPRatingPlanIds(attrs AttrGetTPRatingPlanIds, reply *[]s } // Removes specific RatingPlan on Tariff plan -func (self *ApierV1) RemTPRatingPlan(attrs AttrGetTPRatingPlan, reply *string) error { +func (self *ApierV1) RemoveTPRatingPlan(attrs AttrGetTPRatingPlan, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpratingplans_it_test.go b/apier/v1/tpratingplans_it_test.go index fe13a2cfb..0180e5fc4 100644 --- a/apier/v1/tpratingplans_it_test.go +++ b/apier/v1/tpratingplans_it_test.go @@ -53,7 +53,7 @@ var sTestsTPRatingPlans = []func(t *testing.T){ testTPRatingPlansGetTPRatingPlanIds, testTPRatingPlansUpdateTPRatingPlan, testTPRatingPlansGetTPRatingPlanAfterUpdate, - testTPRatingPlansRemTPRatingPlan, + testTPRatingPlansRemoveTPRatingPlan, testTPRatingPlansGetTPRatingPlanAfterRemove, testTPRatingPlansKillEngine, } @@ -218,9 +218,9 @@ func testTPRatingPlansGetTPRatingPlanAfterUpdate(t *testing.T) { } } -func testTPRatingPlansRemTPRatingPlan(t *testing.T) { +func testTPRatingPlansRemoveTPRatingPlan(t *testing.T) { var resp string - if err := tpRatingPlanRPC.Call("ApierV1.RemTPRatingPlan", + if err := tpRatingPlanRPC.Call("ApierV1.RemoveTPRatingPlan", &AttrGetTPRatingPlan{TPid: "TPRP1", ID: "Plan1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpratingprofiles.go b/apier/v1/tpratingprofiles.go index 20546228b..539ac0fe5 100644 --- a/apier/v1/tpratingprofiles.go +++ b/apier/v1/tpratingprofiles.go @@ -133,7 +133,7 @@ func (self *ApierV1) GetTPRatingProfileIds(attrs AttrGetTPRatingProfileIds, repl } // Removes specific RatingProfiles on Tariff plan -func (self *ApierV1) RemTPRatingProfile(attrs AttrGetTPRatingProfile, reply *string) error { +func (self *ApierV1) RemoveTPRatingProfile(attrs AttrGetTPRatingProfile, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "RatingProfileId"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpratingprofiles_it_test.go b/apier/v1/tpratingprofiles_it_test.go index 478847d36..d5ea27d1b 100644 --- a/apier/v1/tpratingprofiles_it_test.go +++ b/apier/v1/tpratingprofiles_it_test.go @@ -56,7 +56,7 @@ var sTestsTPRatingProfiles = []func(t *testing.T){ testTPRatingProfilesUpdateTPRatingProfile, testTPRatingProfilesGetTPRatingProfileAfterUpdate, testTPRatingProfilesGetTPRatingProfileIds, - testTPRatingProfilesRemTPRatingProfile, + testTPRatingProfilesRemoveTPRatingProfile, testTPRatingProfilesGetTPRatingProfileAfterRemove, testTPRatingProfilesKillEngine, } @@ -268,9 +268,9 @@ func testTPRatingProfilesGetTPRatingProfileIds(t *testing.T) { } } -func testTPRatingProfilesRemTPRatingProfile(t *testing.T) { +func testTPRatingProfilesRemoveTPRatingProfile(t *testing.T) { var resp string - if err := tpRatingProfileRPC.Call("ApierV1.RemTPRatingProfile", + if err := tpRatingProfileRPC.Call("ApierV1.RemoveTPRatingProfile", &AttrGetTPRatingProfile{TPid: "TPRProf1", RatingProfileId: tpRatingProfile.GetRatingProfilesId()}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpresources.go b/apier/v1/tpresources.go index 1298b76ab..d4c506022 100644 --- a/apier/v1/tpresources.go +++ b/apier/v1/tpresources.go @@ -72,7 +72,7 @@ func (self *ApierV1) GetTPResourceIDs(attrs *AttrGetTPResourceIds, reply *[]stri } // Removes specific Resource on Tariff plan -func (self *ApierV1) RemTPResource(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPResource(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpresources_it_test.go b/apier/v1/tpresources_it_test.go index d6af70eb9..53e09c7d5 100644 --- a/apier/v1/tpresources_it_test.go +++ b/apier/v1/tpresources_it_test.go @@ -53,7 +53,7 @@ var sTestsTPResources = []func(t *testing.T){ testTPResGetTPResourceAfterSet, testTPResUpdateTPResource, testTPResGetTPResourceAfterUpdate, - testTPResRemTPResource, + testTPResRemoveTPResource, testTPResGetTPResourceAfterRemove, testTPResKillEngine, } @@ -187,9 +187,9 @@ func testTPResGetTPResourceAfterUpdate(t *testing.T) { } } -func testTPResRemTPResource(t *testing.T) { +func testTPResRemoveTPResource(t *testing.T) { var resp string - if err := tpResRPC.Call("ApierV1.RemTPResource", &utils.TPTntID{TPid: "TPR1", Tenant: "cgrates.org", ID: "ResGroup1"}, + if err := tpResRPC.Call("ApierV1.RemoveTPResource", &utils.TPTntID{TPid: "TPR1", Tenant: "cgrates.org", ID: "ResGroup1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpsharedgroups.go b/apier/v1/tpsharedgroups.go index 97e81c68d..a9a33a76e 100644 --- a/apier/v1/tpsharedgroups.go +++ b/apier/v1/tpsharedgroups.go @@ -77,7 +77,7 @@ func (self *ApierV1) GetTPSharedGroupIds(attrs AttrGetTPSharedGroupIds, reply *[ } // Removes specific SharedGroups on Tariff plan -func (self *ApierV1) RemTPSharedGroups(attrs AttrGetTPSharedGroups, reply *string) error { +func (self *ApierV1) RemoveTPSharedGroups(attrs AttrGetTPSharedGroups, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpsharedgroups_it_test.go b/apier/v1/tpsharedgroups_it_test.go index ad5b95108..095bac36d 100644 --- a/apier/v1/tpsharedgroups_it_test.go +++ b/apier/v1/tpsharedgroups_it_test.go @@ -53,7 +53,7 @@ var sTestsTPSharedGroups = []func(t *testing.T){ testTPSharedGroupsGetTPSharedGroupIds, testTPSharedGroupsUpdateTPShareGroups, testTpSharedGroupsGetTPSharedGroupsAfterUpdate, - testTPSharedGroupsRemTPSharedGroups, + testTPSharedGroupsRemoveTPSharedGroups, testTPSharedGroupsGetTPSharedGroupsAfterRemove, testTPSharedGroupsKillEngine, } @@ -214,9 +214,9 @@ func testTpSharedGroupsGetTPSharedGroupsAfterUpdate(t *testing.T) { } } -func testTPSharedGroupsRemTPSharedGroups(t *testing.T) { +func testTPSharedGroupsRemoveTPSharedGroups(t *testing.T) { var resp string - if err := tpSharedGroupRPC.Call("ApierV1.RemTPSharedGroups", &AttrGetTPSharedGroups{TPid: tpSharedGroups.TPid, ID: tpSharedGroups.ID}, &resp); err != nil { + if err := tpSharedGroupRPC.Call("ApierV1.RemoveTPSharedGroups", &AttrGetTPSharedGroups{TPid: tpSharedGroups.TPid, ID: tpSharedGroups.ID}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) diff --git a/apier/v1/tpstats.go b/apier/v1/tpstats.go index 4a0ff1d4e..d7f5b1468 100644 --- a/apier/v1/tpstats.go +++ b/apier/v1/tpstats.go @@ -74,7 +74,7 @@ func (self *ApierV1) GetTPStatIDs(attrs *AttrGetTPStatIds, reply *[]string) erro } // Removes specific Stat on Tariff plan -func (self *ApierV1) RemTPStat(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPStat(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpstats_it_test.go b/apier/v1/tpstats_it_test.go index 652609a1e..a964f4d6c 100644 --- a/apier/v1/tpstats_it_test.go +++ b/apier/v1/tpstats_it_test.go @@ -54,7 +54,7 @@ var sTestsTPStats = []func(t *testing.T){ testTPStatsGetTPStatAfterSet, testTPStatsUpdateTPStat, testTPStatsGetTPStatAfterUpdate, - testTPStatsRemTPStat, + testTPStatsRemoveTPStat, testTPStatsGetTPStatAfterRemove, testTPStatsKillEngine, } @@ -204,9 +204,9 @@ func testTPStatsGetTPStatAfterUpdate(t *testing.T) { } } -func testTPStatsRemTPStat(t *testing.T) { +func testTPStatsRemoveTPStat(t *testing.T) { var resp string - if err := tpStatRPC.Call("ApierV1.RemTPStat", + if err := tpStatRPC.Call("ApierV1.RemoveTPStat", &utils.TPTntID{TPid: "TPS1", Tenant: "cgrates.org", ID: "Stat1"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tpsuppliers.go b/apier/v1/tpsuppliers.go index 4ac78406d..a1303f723 100644 --- a/apier/v1/tpsuppliers.go +++ b/apier/v1/tpsuppliers.go @@ -73,7 +73,7 @@ func (self *ApierV1) GetTPSupplierProfileIDs(attrs *AttrGetTPSupplierProfileIDs, } // Removes specific SupplierProfile on Tariff plan -func (self *ApierV1) RemTPSupplierProfile(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPSupplierProfile(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpsuppliers_it_test.go b/apier/v1/tpsuppliers_it_test.go index d7075bc1d..c8c575536 100644 --- a/apier/v1/tpsuppliers_it_test.go +++ b/apier/v1/tpsuppliers_it_test.go @@ -235,7 +235,7 @@ func testTPSplPrfGetTPSplPrfAfterUpdate(t *testing.T) { func testTPSplPrfRemTPSplPrf(t *testing.T) { var resp string - if err := tpSplPrfRPC.Call("ApierV1.RemTPSupplierProfile", + if err := tpSplPrfRPC.Call("ApierV1.RemoveTPSupplierProfile", &utils.TPTntID{TPid: "TP1", Tenant: "cgrates.org", ID: "SUPL_1"}, &resp); err != nil { t.Error(err) diff --git a/apier/v1/tpthresholds.go b/apier/v1/tpthresholds.go index acb2bceee..4f695077a 100644 --- a/apier/v1/tpthresholds.go +++ b/apier/v1/tpthresholds.go @@ -73,7 +73,7 @@ func (self *ApierV1) GetTPThresholdIDs(attrs *AttrGetTPThresholdIds, reply *[]st } // Removes specific Threshold on Tariff plan -func (self *ApierV1) RemTPThreshold(attrs *utils.TPTntID, reply *string) error { +func (self *ApierV1) RemoveTPThreshold(attrs *utils.TPTntID, reply *string) error { if missing := utils.MissingStructFields(attrs, []string{"TPid", "Tenant", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tpthresholds_it_test.go b/apier/v1/tpthresholds_it_test.go index da893cdba..4c2303fd1 100644 --- a/apier/v1/tpthresholds_it_test.go +++ b/apier/v1/tpthresholds_it_test.go @@ -201,7 +201,7 @@ func testTPThreholdGetTPThreholdAfterUpdate(t *testing.T) { func testTPThreholdRemTPThrehold(t *testing.T) { var resp string - if err := tpThresholdRPC.Call("ApierV1.RemTPThreshold", + if err := tpThresholdRPC.Call("ApierV1.RemoveTPThreshold", &utils.TPTntID{TPid: "TH1", Tenant: "cgrates.org", ID: "Threshold"}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { diff --git a/apier/v1/tptimings.go b/apier/v1/tptimings.go index a09196efc..6b5db09ae 100644 --- a/apier/v1/tptimings.go +++ b/apier/v1/tptimings.go @@ -77,7 +77,7 @@ func (self *ApierV1) GetTPTimingIds(attrs AttrGetTPTimingIds, reply *[]string) e } // Removes specific Timing on Tariff plan -func (self *ApierV1) RemTPTiming(attrs AttrGetTPTiming, reply *string) error { +func (self *ApierV1) RemoveTPTiming(attrs AttrGetTPTiming, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "ID"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/apier/v1/tptimings_it_test.go b/apier/v1/tptimings_it_test.go index b6533ef59..00112a364 100644 --- a/apier/v1/tptimings_it_test.go +++ b/apier/v1/tptimings_it_test.go @@ -53,7 +53,7 @@ var sTestsTPTiming = []func(t *testing.T){ testTPTimingsGetTPTimingIds, testTPTimingsUpdateTPTiming, testTPTimingsGetTPTimingAfterUpdate, - testTPTimingsRemTPTiming, + testTPTimingsRemoveTPTiming, testTPTimingsGetTPTimingAfterRemove, testTPTimingsKillEngine, } @@ -183,9 +183,9 @@ func testTPTimingsGetTPTimingAfterUpdate(t *testing.T) { } } -func testTPTimingsRemTPTiming(t *testing.T) { +func testTPTimingsRemoveTPTiming(t *testing.T) { var resp string - if err := tpTimingRPC.Call("ApierV1.RemTPTiming", &AttrGetTPTiming{TPid: tpTiming.TPid, ID: tpTiming.ID}, &resp); err != nil { + if err := tpTimingRPC.Call("ApierV1.RemoveTPTiming", &AttrGetTPTiming{TPid: tpTiming.TPid, ID: tpTiming.ID}, &resp); err != nil { t.Error(err) } else if resp != utils.OK { t.Error("Unexpected reply returned", resp) diff --git a/apier/v2/tp_it_test.go b/apier/v2/tp_it_test.go index 16b866444..10a279b26 100644 --- a/apier/v2/tp_it_test.go +++ b/apier/v2/tp_it_test.go @@ -197,10 +197,10 @@ func testTPitTimings(t *testing.T) { t.Errorf("Calling ApierV1.GetTPTimingIds expected: %v, received: %v", expectedTmIDs, rplyTmIDs) } // Test remove - if err := tpRPC.Call("ApierV2.RemTPTiming", v1.AttrGetTPTiming{tmDummyRemove.TPid, tmDummyRemove.ID}, &reply); err != nil { - t.Error("Calling ApierV2.RemTPTiming, got error: ", err.Error()) + if err := tpRPC.Call("ApierV2.RemoveTPTiming", v1.AttrGetTPTiming{tmDummyRemove.TPid, tmDummyRemove.ID}, &reply); err != nil { + t.Error("Calling ApierV2.RemoveTPTiming, got error: ", err.Error()) } else if reply != utils.OK { - t.Error("Calling ApierV2.RemTPTiming received: ", reply) + t.Error("Calling ApierV2.RemoveTPTiming received: ", reply) } // Test getIds rplyTmIDs = []string{} @@ -242,7 +242,7 @@ func testTPitDestinations(t *testing.T) { t.Errorf("Calling ApierV2.GetTPDestination expected: %v, received: %v", dstDEMobile, rplyDst) } // Test remove - if err := tpRPC.Call("ApierV2.RemTPDestination", AttrGetTPDestination{testTPid, dstDUMMY.ID}, &reply); err != nil { + if err := tpRPC.Call("ApierV2.RemoveTPDestination", AttrGetTPDestination{testTPid, dstDUMMY.ID}, &reply); err != nil { t.Error(err) } else if reply != utils.OK { t.Error("Received: ", reply) diff --git a/apier/v2/tpdestinations.go b/apier/v2/tpdestinations.go index 084663353..b37b6bc70 100644 --- a/apier/v2/tpdestinations.go +++ b/apier/v2/tpdestinations.go @@ -54,7 +54,7 @@ func (self *ApierV2) GetTPDestination(attrs AttrGetTPDestination, reply *utils.T return nil } -func (self *ApierV2) RemTPDestination(attrs AttrGetTPDestination, reply *string) error { +func (self *ApierV2) RemoveTPDestination(attrs AttrGetTPDestination, reply *string) error { if missing := utils.MissingStructFields(&attrs, []string{"TPid", "Tag"}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) } diff --git a/console/statqueue_remove.go b/console/statqueue_remove.go index c1e3e23a6..daf900b7e 100644 --- a/console/statqueue_remove.go +++ b/console/statqueue_remove.go @@ -23,7 +23,7 @@ import "github.com/cgrates/cgrates/utils" func init() { c := &CmdRemoveStatQueue{ name: "statqueue_remove", - rpcMethod: "ApierV1.RemStatQueueProfile", + rpcMethod: "ApierV1.RemoveStatQueueProfile", rpcParams: &utils.TenantIDWithCache{}, } commands[c.Name()] = c diff --git a/general_tests/a1_it_test.go b/general_tests/a1_it_test.go index 4dfe9db36..35cd5b85c 100644 --- a/general_tests/a1_it_test.go +++ b/general_tests/a1_it_test.go @@ -327,8 +327,8 @@ func TestA1itConcurrentAPs(t *testing.T) { }(acnt) go func(acnt string) { var reply string - if err := a1rpc.Call("ApierV1.RemActionTiming", - v1.AttrRemActionTiming{Tenant: "cgrates.org", Account: acnt, ActionPlanId: "PACKAGE_1"}, &reply); err != nil { + if err := a1rpc.Call("ApierV1.RemoveActionTiming", + v1.AttrRemoveActionTiming{Tenant: "cgrates.org", Account: acnt, ActionPlanId: "PACKAGE_1"}, &reply); err != nil { t.Error(err) } wg.Done()