mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
Add in engine/chargers_test.go test for processEvent
This commit is contained in:
committed by
Dan Christian Bogos
parent
db41c324f0
commit
28ebd8ec4a
@@ -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]))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user