diff --git a/engine/chargers_test.go b/engine/chargers_test.go index 21d9af1cf..43b94715c 100755 --- a/engine/chargers_test.go +++ b/engine/chargers_test.go @@ -37,8 +37,8 @@ var ( ActivationInterval: &utils.ActivationInterval{ ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC), }, - RunID: "*rated", - AttributeIDs: []string{"ATTR_1"}, + RunID: "TestRunID", + AttributeIDs: []string{"*none"}, Weight: 20, }, &ChargerProfile{ @@ -207,3 +207,20 @@ func TestChargerMatchingChargerProfilesForEvent(t *testing.T) { } } + +func TestChargerProcessEvent(t *testing.T) { + rpl := []*ChrgSProcessEventReply{ + &ChrgSProcessEventReply{ + ChargerSProfile: "CPP_1", + CGREvent: chargerEvents[0], + }, + } + rpl[0].CGREvent.Event[utils.RunID] = cPPs[0].RunID + rcv, err := chargerSrv.processEvent(chargerEvents[0]) + if err != nil { + t.Errorf("Error: %+v", err) + } + if !reflect.DeepEqual(rpl[0], rcv[0]) { + t.Errorf("Expecting: %+v, received: %+v ", utils.ToJSON(rpl[0]), utils.ToJSON(rcv[0])) + } +}