another converter fix

This commit is contained in:
Radu Ioan Fericean
2015-12-15 22:08:28 +02:00
parent d54c12ed81
commit 8b96e7dcfb
2 changed files with 7 additions and 3 deletions

View File

@@ -215,7 +215,7 @@ func APItoModelActionTrigger(ats *utils.TPActionTriggers) (result []TpActionTrig
for _, at := range ats.ActionTriggers {
result = append(result, TpActionTrigger{
Tpid: ats.TPid,
Tag: ats.ActionTriggersId,
Tag: at.Id,
UniqueId: at.UniqueID,
ThresholdType: at.ThresholdType,
ThresholdValue: at.ThresholdValue,

View File

@@ -551,6 +551,8 @@ func TestTPActionPlanAsExportSlice(t *testing.T) {
ActionTriggersId: "STANDARD_TRIGGERS",
ActionTriggers: []*utils.TPActionTrigger{
&utils.TPActionTrigger{
Id: "STANDARD_TRIGGERS",
UniqueID: "1",
ThresholdType: "*min_balance",
ThresholdValue: 2.0,
Recurrent: false,
@@ -570,6 +572,8 @@ func TestTPActionPlanAsExportSlice(t *testing.T) {
ActionsId: "LOG_WARNING",
Weight: 10},
&utils.TPActionTrigger{
Id: "STANDARD_TRIGGERS",
UniqueID: "2",
ThresholdType: "*max_event_counter",
ThresholdValue: 5.0,
Recurrent: false,
@@ -591,8 +595,8 @@ func TestTPActionPlanAsExportSlice(t *testing.T) {
},
}
expectedSlc := [][]string{
[]string{"STANDARD_TRIGGERS", "", "*min_balance", "2", "false", "0", "b1", "*monetary", "*out", "call", "", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"},
[]string{"STANDARD_TRIGGERS", "", "*max_event_counter", "5", "false", "0", "b2", "*monetary", "*out", "call", "FS_USERS", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"},
[]string{"STANDARD_TRIGGERS", "1", "*min_balance", "2", "false", "0", "b1", "*monetary", "*out", "call", "", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"},
[]string{"STANDARD_TRIGGERS", "2", "*max_event_counter", "5", "false", "0", "b2", "*monetary", "*out", "call", "FS_USERS", "special1", "SHARED_1", "*never", "T1", "0", "false", "0", "LOG_WARNING", "10"},
}
ms := APItoModelActionTrigger(at)
var slc [][]string