Updated analyzers integration tests

This commit is contained in:
Trial97
2021-01-14 11:41:22 +02:00
committed by Dan Christian Bogos
parent ebc947f2af
commit 8cb458c0eb
3 changed files with 30 additions and 16 deletions

View File

@@ -137,15 +137,13 @@ func testAnalyzerSLoadTarrifPlans(t *testing.T) {
}
func testAnalyzerSChargerSv1ProcessEvent(t *testing.T) {
cgrEv := &utils.CGREventWithOpts{
CGREvent: &utils.CGREvent{
Tenant: "cgrates.org",
ID: "event1",
Event: map[string]interface{}{
utils.AccountField: "1010",
utils.Subject: "Something_inter",
utils.Destination: "999",
},
cgrEv := &utils.CGREvent{
Tenant: "cgrates.org",
ID: "event1",
Event: map[string]interface{}{
utils.AccountField: "1010",
utils.Subject: "Something_inter",
utils.Destination: "999",
},
}
var result2 []*engine.ChrgSProcessEventReply
@@ -163,8 +161,8 @@ func testAnalyzerSChargerSv1ProcessEvent(t *testing.T) {
"RunID": "*default",
"Subject": "Something_inter",
},
Opts: map[string]interface{}{"*subsys": "*chargers"},
},
Opts: map[string]interface{}{"*subsys": "*chargers"},
},
{
ChargerSProfile: "Raw",
@@ -180,8 +178,8 @@ func testAnalyzerSChargerSv1ProcessEvent(t *testing.T) {
"RunID": "*raw",
"Subject": "Something_inter",
},
Opts: map[string]interface{}{"*subsys": "*chargers"},
},
Opts: map[string]interface{}{"*subsys": "*chargers"},
},
}

View File

@@ -18,7 +18,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package analyzers
/*
import (
"encoding/json"
"os"
"reflect"
"runtime"
"strconv"
"testing"
"time"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/search"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
func TestNewAnalyzerService(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
cfg.AnalyzerSCfg().DBPath = "/tmp/analyzers"
@@ -246,7 +261,7 @@ func TestAnalyzersV1Search(t *testing.T) {
"RequestEncoding": "*gob",
"RequestID": 3.,
"RequestMethod": "CoreSv1.Ping",
"RequestParams": json.RawMessage(`{"Tenant": "","ID": "","Time": null,"Event": null,"Opts": {"EventSource": "*attributes"}}`),
"RequestParams": json.RawMessage(`{"Tenant":"","ID":"","Time":null,"Event":null,"Opts":{"EventSource":"*attributes"}}`),
"Reply": json.RawMessage(`"Pong"`),
"RequestSource": "127.0.0.1:5566",
"RequestStartTime": t1.Add(-24 * time.Hour).UTC().Format(time.RFC3339),
@@ -386,4 +401,3 @@ func TestAnalyzersV1Search(t *testing.T) {
t.Fatal(err)
}
}
*/