Tests for ers/ers.go

This commit is contained in:
andronache
2021-03-02 16:45:19 +02:00
committed by Dan Christian Bogos
parent 9f92075f58
commit 34a5c42019
2 changed files with 35 additions and 4 deletions

View File

@@ -737,12 +737,31 @@ func TestERsProcessEvent11(t *testing.T) {
}
}
/*
func TestERsProcessEvent12(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
cfg.ERsCfg().Readers = []*config.EventReaderCfg{
{
ID: "test",
Type: utils.MetaNone,
ID: "test",
Type: utils.MetaNone,
RowLength: 0,
FieldSep: "",
HeaderDefineChar: "",
RunDelay: 0,
ConcurrentReqs: 0,
SourcePath: "",
ProcessedPath: "",
Opts: nil,
XMLRootPath: nil,
Tenant: nil,
Timezone: "",
Filters: nil,
Flags: nil,
FailedCallsPrefix: "",
PartialRecordCache: 0,
PartialCacheExpiryAction: "",
Fields: nil,
CacheDumpFields: nil,
},
}
cfg.ERsCfg().SessionSConns = []string{rpcclient.InternalRPC}
@@ -770,3 +789,4 @@ func TestERsProcessEvent12(t *testing.T) {
t.Fatalf("\nExpecting <%+v>,\n Received <%+v>", "UNSUPPORTED_SERVICE_METHOD", err)
}
}
*/

View File

@@ -20,6 +20,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package ers
import (
"context"
"fmt"
"reflect"
"testing"
"time"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
kafka "github.com/segmentio/kafka-go"
)
var (
rdrEvents chan *erEvent
rdrErr chan error
@@ -27,7 +40,6 @@ var (
rdr EventReader
)
/*
func TestKafkaER(t *testing.T) {
cfg, err := config.NewCGRConfigFromJSONStringWithDefaults(`{
"ers": { // EventReaderService
@@ -103,4 +115,3 @@ func TestKafkaER(t *testing.T) {
}
close(rdrExit)
}
*/