/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
*/
package config

import (
	"reflect"
	"testing"
	"time"

	"github.com/cgrates/cgrates/utils"
)

func TestLoadCdrcConfigMultipleFiles(t *testing.T) {
	cgrCfg, err := NewCGRConfigFromPath(".")
	if err != nil {
		t.Error(err)
	}
	eCgrCfg, _ := NewDefaultCGRConfig()
	eCgrCfg.CdrcProfiles = make(map[string][]*CdrcCfg)
	// Default instance first
	eCgrCfg.CdrcProfiles["/var/spool/cgrates/cdrc/in"] = []*CdrcCfg{
		{
			ID:                       utils.META_DEFAULT,
			Enabled:                  false,
			CdrsConns:                []*RemoteHost{{Address: utils.MetaInternal}},
			CdrFormat:                "*file_csv",
			FieldSeparator:           ',',
			RunDelay:                 0,
			MaxOpenFiles:             1024,
			CDRInPath:                "/var/spool/cgrates/cdrc/in",
			CDROutPath:               "/var/spool/cgrates/cdrc/out",
			FailedCallsPrefix:        "missed_calls",
			CDRRootPath:              utils.HierarchyPath([]string{""}),
			CdrSourceId:              "cdrc_csv",
			Filters:                  []string{},
			PartialRecordCache:       time.Duration(10) * time.Second,
			PartialCacheExpiryAction: utils.MetaDumpToFile,
			HeaderFields:             make([]*FCTemplate, 0),
			ContentFields: []*FCTemplate{
				{Tag: "TOR", Type: utils.META_COMPOSED, FieldId: utils.ToR,
					Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "OriginID", Type: utils.META_COMPOSED, FieldId: utils.OriginID,
					Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "RequestType", Type: utils.META_COMPOSED, FieldId: utils.RequestType,
					Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Tenant", Type: utils.META_COMPOSED, FieldId: utils.Tenant,
					Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Category", Type: utils.META_COMPOSED, FieldId: utils.Category,
					Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Account", Type: utils.META_COMPOSED, FieldId: utils.Account,
					Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Subject", Type: utils.META_COMPOSED, FieldId: utils.Subject,
					Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Destination", Type: utils.META_COMPOSED, FieldId: utils.Destination,
					Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "SetupTime", Type: utils.META_COMPOSED, FieldId: utils.SetupTime,
					Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED, FieldId: utils.AnswerTime,
					Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Usage", Type: utils.META_COMPOSED, FieldId: utils.Usage,
					Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP), Mandatory: true},
			},
			TrailerFields: make([]*FCTemplate, 0),
			CacheDumpFields: []*FCTemplate{
				{Tag: "CGRID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.CGRID, true, utils.INFIELD_SEP)},
				{Tag: "RunID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RunID, true, utils.INFIELD_SEP)},
				{Tag: "TOR", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.ToR, true, utils.INFIELD_SEP)},
				{Tag: "OriginID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.OriginID, true, utils.INFIELD_SEP)},
				{Tag: "RequestType", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RequestType, true, utils.INFIELD_SEP)},
				{Tag: "Tenant", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Tenant, true, utils.INFIELD_SEP)},
				{Tag: "Category", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Category, true, utils.INFIELD_SEP)},
				{Tag: "Account", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Account, true, utils.INFIELD_SEP)},
				{Tag: "Subject", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Subject, true, utils.INFIELD_SEP)},
				{Tag: "Destination", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Destination, true, utils.INFIELD_SEP)},
				{Tag: "SetupTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.SetupTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.AnswerTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "Usage", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Usage, true, utils.INFIELD_SEP)},
				{Tag: "Cost", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.COST, true, utils.INFIELD_SEP)},
			},
		},
	}
	eCgrCfg.CdrcProfiles["/tmp/cgrates/cdrc1/in"] = []*CdrcCfg{
		{
			ID:                       "CDRC-CSV1",
			Enabled:                  true,
			CdrsConns:                []*RemoteHost{{Address: utils.MetaInternal}},
			CdrFormat:                "*file_csv",
			FieldSeparator:           ',',
			RunDelay:                 0,
			MaxOpenFiles:             1024,
			CDRInPath:                "/tmp/cgrates/cdrc1/in",
			CDROutPath:               "/tmp/cgrates/cdrc1/out",
			FailedCallsPrefix:        "missed_calls",
			CDRRootPath:              utils.HierarchyPath([]string{""}),
			CdrSourceId:              "csv1",
			Filters:                  []string{},
			PartialRecordCache:       time.Duration(10) * time.Second,
			PartialCacheExpiryAction: utils.MetaDumpToFile,
			HeaderFields:             make([]*FCTemplate, 0),
			ContentFields: []*FCTemplate{
				{Tag: "TOR", Type: utils.META_COMPOSED, FieldId: utils.ToR,
					Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "OriginID", Type: utils.META_COMPOSED, FieldId: utils.OriginID,
					Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "RequestType", Type: utils.META_COMPOSED, FieldId: utils.RequestType,
					Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Tenant", Type: utils.META_COMPOSED, FieldId: utils.Tenant,
					Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Category", Type: utils.META_COMPOSED, FieldId: utils.Category,
					Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Account", Type: utils.META_COMPOSED, FieldId: utils.Account,
					Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Subject", Type: utils.META_COMPOSED, FieldId: utils.Subject,
					Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Destination", Type: utils.META_COMPOSED, FieldId: utils.Destination,
					Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "SetupTime", Type: utils.META_COMPOSED, FieldId: utils.SetupTime,
					Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED, FieldId: utils.AnswerTime,
					Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Usage", Type: utils.META_COMPOSED, FieldId: utils.Usage,
					Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP), Mandatory: true},
			},
			TrailerFields: make([]*FCTemplate, 0),
			CacheDumpFields: []*FCTemplate{
				{Tag: "CGRID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.CGRID, true, utils.INFIELD_SEP)},
				{Tag: "RunID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RunID, true, utils.INFIELD_SEP)},
				{Tag: "TOR", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.ToR, true, utils.INFIELD_SEP)},
				{Tag: "OriginID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.OriginID, true, utils.INFIELD_SEP)},
				{Tag: "RequestType", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RequestType, true, utils.INFIELD_SEP)},
				{Tag: "Tenant", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Tenant, true, utils.INFIELD_SEP)},
				{Tag: "Category", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Category, true, utils.INFIELD_SEP)},
				{Tag: "Account", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Account, true, utils.INFIELD_SEP)},
				{Tag: "Subject", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Subject, true, utils.INFIELD_SEP)},
				{Tag: "Destination", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Destination, true, utils.INFIELD_SEP)},
				{Tag: "SetupTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.SetupTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.AnswerTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "Usage", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Usage, true, utils.INFIELD_SEP)},
				{Tag: "Cost", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.COST, true, utils.INFIELD_SEP)},
			},
		},
	}
	eCgrCfg.CdrcProfiles["/tmp/cgrates/cdrc2/in"] = []*CdrcCfg{
		{
			ID:                       "CDRC-CSV2",
			Enabled:                  true,
			CdrsConns:                []*RemoteHost{{Address: utils.MetaInternal}},
			CdrFormat:                "*file_csv",
			FieldSeparator:           ',',
			RunDelay:                 1000000000,
			MaxOpenFiles:             1024,
			CDRInPath:                "/tmp/cgrates/cdrc2/in",
			CDROutPath:               "/tmp/cgrates/cdrc2/out",
			FailedCallsPrefix:        "missed_calls",
			CDRRootPath:              utils.HierarchyPath([]string{""}),
			CdrSourceId:              "csv2",
			Filters:                  []string{},
			PartialRecordCache:       time.Duration(10) * time.Second,
			PartialCacheExpiryAction: utils.MetaDumpToFile,
			HeaderFields:             make([]*FCTemplate, 0),
			ContentFields: []*FCTemplate{
				{Tag: utils.ToR, FieldId: utils.ToR,
					Value: NewRSRParsersMustCompile("~7:s/^(voice|data|sms|mms|generic)$/*$1/", true, utils.INFIELD_SEP)},
				{Tag: utils.AnswerTime, Type: "", FieldId: utils.AnswerTime,
					Value: NewRSRParsersMustCompile("~1", true, utils.INFIELD_SEP)},
				{Tag: utils.Usage, FieldId: utils.Usage,
					Value: NewRSRParsersMustCompile("~9:s/^(\\d+)$/${1}s/", true, utils.INFIELD_SEP)},
			},
			TrailerFields: make([]*FCTemplate, 0),
			CacheDumpFields: []*FCTemplate{
				{Tag: "CGRID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.CGRID, true, utils.INFIELD_SEP)},
				{Tag: "RunID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RunID, true, utils.INFIELD_SEP)},
				{Tag: "TOR", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.ToR, true, utils.INFIELD_SEP)},
				{Tag: "OriginID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.OriginID, true, utils.INFIELD_SEP)},
				{Tag: "RequestType", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RequestType, true, utils.INFIELD_SEP)},
				{Tag: "Tenant", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Tenant, true, utils.INFIELD_SEP)},
				{Tag: "Category", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Category, true, utils.INFIELD_SEP)},
				{Tag: "Account", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Account, true, utils.INFIELD_SEP)},
				{Tag: "Subject", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Subject, true, utils.INFIELD_SEP)},
				{Tag: "Destination", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Destination, true, utils.INFIELD_SEP)},
				{Tag: "SetupTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.SetupTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.AnswerTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "Usage", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Usage, true, utils.INFIELD_SEP)},
				{Tag: "Cost", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.COST, true, utils.INFIELD_SEP)},
			},
		},
	}
	eCgrCfg.CdrcProfiles["/tmp/cgrates/cdrc3/in"] = []*CdrcCfg{
		{
			ID:                       "CDRC-CSV3",
			Enabled:                  true,
			CdrsConns:                []*RemoteHost{{Address: utils.MetaInternal}},
			CdrFormat:                utils.MetaFileCSV,
			FieldSeparator:           ',',
			RunDelay:                 0,
			MaxOpenFiles:             1024,
			CDRInPath:                "/tmp/cgrates/cdrc3/in",
			CDROutPath:               "/tmp/cgrates/cdrc3/out",
			FailedCallsPrefix:        "missed_calls",
			CDRRootPath:              utils.HierarchyPath([]string{""}),
			CdrSourceId:              "csv3",
			Filters:                  []string{},
			PartialRecordCache:       time.Duration(10) * time.Second,
			PartialCacheExpiryAction: utils.MetaDumpToFile,
			HeaderFields:             make([]*FCTemplate, 0),
			ContentFields: []*FCTemplate{
				{Tag: "TOR", Type: utils.META_COMPOSED, FieldId: utils.ToR,
					Value: NewRSRParsersMustCompile("~2", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "OriginID", Type: utils.META_COMPOSED, FieldId: utils.OriginID,
					Value: NewRSRParsersMustCompile("~3", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "RequestType", Type: utils.META_COMPOSED, FieldId: utils.RequestType,
					Value: NewRSRParsersMustCompile("~4", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Tenant", Type: utils.META_COMPOSED, FieldId: utils.Tenant,
					Value: NewRSRParsersMustCompile("~6", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Category", Type: utils.META_COMPOSED, FieldId: utils.Category,
					Value: NewRSRParsersMustCompile("~7", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Account", Type: utils.META_COMPOSED, FieldId: utils.Account,
					Value: NewRSRParsersMustCompile("~8", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Subject", Type: utils.META_COMPOSED, FieldId: utils.Subject,
					Value: NewRSRParsersMustCompile("~9", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Destination", Type: utils.META_COMPOSED, FieldId: utils.Destination,
					Value: NewRSRParsersMustCompile("~10", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "SetupTime", Type: utils.META_COMPOSED, FieldId: utils.SetupTime,
					Value: NewRSRParsersMustCompile("~11", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED, FieldId: utils.AnswerTime,
					Value: NewRSRParsersMustCompile("~12", true, utils.INFIELD_SEP), Mandatory: true},
				{Tag: "Usage", Type: utils.META_COMPOSED, FieldId: utils.Usage,
					Value: NewRSRParsersMustCompile("~13", true, utils.INFIELD_SEP), Mandatory: true},
			},
			TrailerFields: make([]*FCTemplate, 0),
			CacheDumpFields: []*FCTemplate{
				{Tag: "CGRID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.CGRID, true, utils.INFIELD_SEP)},
				{Tag: "RunID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RunID, true, utils.INFIELD_SEP)},
				{Tag: "TOR", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.ToR, true, utils.INFIELD_SEP)},
				{Tag: "OriginID", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.OriginID, true, utils.INFIELD_SEP)},
				{Tag: "RequestType", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.RequestType, true, utils.INFIELD_SEP)},
				{Tag: "Tenant", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Tenant, true, utils.INFIELD_SEP)},
				{Tag: "Category", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Category, true, utils.INFIELD_SEP)},
				{Tag: "Account", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Account, true, utils.INFIELD_SEP)},
				{Tag: "Subject", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Subject, true, utils.INFIELD_SEP)},
				{Tag: "Destination", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Destination, true, utils.INFIELD_SEP)},
				{Tag: "SetupTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.SetupTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "AnswerTime", Type: utils.META_COMPOSED,
					Value:  NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.AnswerTime, true, utils.INFIELD_SEP),
					Layout: "2006-01-02T15:04:05Z07:00"},
				{Tag: "Usage", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.Usage, true, utils.INFIELD_SEP)},
				{Tag: "Cost", Type: utils.META_COMPOSED,
					Value: NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.COST, true, utils.INFIELD_SEP)},
			},
		},
	}
	if !reflect.DeepEqual(eCgrCfg.CdrcProfiles, cgrCfg.CdrcProfiles) {
		t.Errorf("Expected: %s \n, received: %s", utils.ToJSON(eCgrCfg.CdrcProfiles), utils.ToJSON(cgrCfg.CdrcProfiles))
	}
}
