mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Migrator - limit attribute profiles out of derived chargers to *chargers context
This commit is contained in:
@@ -92,7 +92,7 @@ func derivedChargers2AttributeProfile(dc *v1DerivedCharger, tenant, key string,
|
||||
attr = &engine.AttributeProfile{
|
||||
Tenant: tenant,
|
||||
ID: key,
|
||||
Contexts: []string{utils.META_ANY},
|
||||
Contexts: []string{utils.MetaChargers},
|
||||
FilterIDs: filters,
|
||||
ActivationInterval: nil,
|
||||
Attributes: make([]*engine.Attribute, 0),
|
||||
|
||||
@@ -160,7 +160,7 @@ func testDCITMigrateAndMove(t *testing.T) {
|
||||
attrProf := &engine.AttributeProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: fmt.Sprintf("%s_%v", derivch.Key, 0),
|
||||
Contexts: []string{utils.META_ANY},
|
||||
Contexts: []string{utils.MetaChargers},
|
||||
FilterIDs: []string{
|
||||
"*destinations:~Destination:1001;1002;1003",
|
||||
"*string:~Account:1003",
|
||||
@@ -251,7 +251,7 @@ func testDCITMigrateAndMove(t *testing.T) {
|
||||
},
|
||||
}
|
||||
if dcidx, err := dcMigrator.dmOut.DataManager().GetFilterIndexes(utils.PrefixToIndexCache[utils.AttributeProfilePrefix],
|
||||
utils.ConcatenatedKey("cgrates.org", utils.META_ANY), utils.MetaString, nil); err != nil {
|
||||
utils.ConcatenatedKey("cgrates.org", utils.MetaChargers), utils.MetaString, nil); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(expDcIdx, dcidx) {
|
||||
t.Errorf("Expected %v, recived: %v", utils.ToJSON(expDcIdx), utils.ToJSON(dcidx))
|
||||
@@ -262,7 +262,7 @@ func testDCITMigrateAndMove(t *testing.T) {
|
||||
},
|
||||
}
|
||||
if dcidx, err := dcMigrator.dmOut.DataManager().GetFilterIndexes(utils.PrefixToIndexCache[utils.ChargerProfilePrefix],
|
||||
utils.ConcatenatedKey("cgrates.org", utils.META_ANY),
|
||||
utils.ConcatenatedKey("cgrates.org", utils.MetaChargers),
|
||||
utils.MetaString, nil); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Errorf("Expected error %v, recived: %v with reply: %v", utils.ErrNotFound, err, utils.ToJSON(dcidx))
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func TestDerivedChargers2AttributeProfile(t *testing.T) {
|
||||
Expected: &engine.AttributeProfile{
|
||||
Tenant: defaultTenant,
|
||||
ID: "key1",
|
||||
Contexts: []string{utils.META_ANY},
|
||||
Contexts: []string{utils.MetaChargers},
|
||||
FilterIDs: make([]string, 0),
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
@@ -149,7 +149,7 @@ func TestDerivedChargers2AttributeProfile(t *testing.T) {
|
||||
Expected: &engine.AttributeProfile{
|
||||
Tenant: defaultTenant,
|
||||
ID: "key1",
|
||||
Contexts: []string{utils.META_ANY},
|
||||
Contexts: []string{utils.MetaChargers},
|
||||
FilterIDs: []string{"*string:~Subject:1005"},
|
||||
ActivationInterval: nil,
|
||||
Attributes: []*engine.Attribute{
|
||||
|
||||
Reference in New Issue
Block a user