diff --git a/apier/v1/accounts_it_test.go b/apier/v1/accounts_it_test.go index 9c28b60ee..dfacfb3ea 100644 --- a/apier/v1/accounts_it_test.go +++ b/apier/v1/accounts_it_test.go @@ -63,7 +63,7 @@ var ( testAccITCountAccounts, testAccITTPFromFolder, testAccITAddBalanceWithDestinations, - //testAccITAccountWithTriggers, + testAccITAccountWithTriggers, testAccITStopCgrEngine, } ) @@ -780,7 +780,6 @@ func testAccITAddBalanceWithDestinations(t *testing.T) { } } -/* Uncomment this test when found a solution for SetActions func testAccITAccountWithTriggers(t *testing.T) { var reply string args := &utils.AttrSetBalance{ @@ -910,8 +909,8 @@ func testAccITAccountWithTriggers(t *testing.T) { } else { for _, value := range acnt.BalanceMap[utils.MONETARY] { if value.ID == "testAccITAccountWithTriggers" { - if value.GetValue() != 2 { - t.Errorf("Expecting %+v, received: %+v", 2, value.GetValue()) + if value.GetValue() != 5 { + t.Errorf("Expecting %+v, received: %+v", 5, value.GetValue()) } } else if value.ID == "CustomBanalce" { if value.GetValue() != 5 { @@ -922,11 +921,10 @@ func testAccITAccountWithTriggers(t *testing.T) { if len(acnt.ActionTriggers) != 1 { t.Errorf("Expected 1, received: %+v", len(acnt.ActionTriggers)) } else { - if acnt.ActionTriggers[0].Executed != true { + if acnt.ActionTriggers[0].Executed != false { t.Errorf("Expected true, received: %+v", acnt.ActionTriggers[0].Executed) } } } } -*/ diff --git a/apier/v2/apier.go b/apier/v2/apier.go index 402876ba3..a50ac3ea2 100644 --- a/apier/v2/apier.go +++ b/apier/v2/apier.go @@ -325,7 +325,9 @@ func (apiv2 *APIerSv2) SetActions(attrs *utils.AttrSetActions, reply *string) er ExpirationString: apiAct.ExpiryTime, ExtraParameters: apiAct.ExtraParameters, Filter: apiAct.Filter, - Balance: &engine.BalanceFilter{ // TODO: update this part + } + if apiAct.Identifier != utils.RESET_TRIGGERS { // add an exception for ResetTriggers + a.Balance = &engine.BalanceFilter{ // TODO: update this part Uuid: utils.StringPointer(apiAct.BalanceUuid), ID: utils.StringPointer(apiAct.BalanceId), Type: utils.StringPointer(apiAct.BalanceType), @@ -338,7 +340,7 @@ func (apiv2 *APIerSv2) SetActions(attrs *utils.AttrSetActions, reply *string) er TimingIDs: utils.StringMapPointer(utils.ParseStringMap(apiAct.TimingTags)), Blocker: blocker, Disabled: disabled, - }, + } } storeActions[idx] = a }