From c62e86632053035bcfb04ecf4046d06160779469 Mon Sep 17 00:00:00 2001 From: DanB Date: Thu, 19 Jul 2018 19:41:09 +0200 Subject: [PATCH] Updating AttributeSv1 integration tests with MatchingProfiles --- apier/v1/attributes_it_test.go | 32 ++++++++++++++++---------------- apier/v1/chargers_it_test.go | 6 +++--- apier/v1/sessionsv1_it_test.go | 16 ++++++++-------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/apier/v1/attributes_it_test.go b/apier/v1/attributes_it_test.go index 949b450df..2e3dd0c7d 100644 --- a/apier/v1/attributes_it_test.go +++ b/apier/v1/attributes_it_test.go @@ -294,8 +294,8 @@ func testAttributeSProcessEvent(t *testing.T) { }, } eRply := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_1", - AlteredFields: []string{utils.Subject, utils.Account}, + MatchedProfiles: []string{"ATTR_1"}, + AlteredFields: []string{utils.Subject, utils.Account}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSProcessEvent", @@ -308,8 +308,8 @@ func testAttributeSProcessEvent(t *testing.T) { }, } eRply2 := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_1", - AlteredFields: []string{utils.Account, utils.Subject}, + MatchedProfiles: []string{"ATTR_1"}, + AlteredFields: []string{utils.Account, utils.Subject}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSProcessEvent", @@ -374,8 +374,8 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) { t.Error("Unexpected reply returned", result) } eRply := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{utils.Account, utils.Subject}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{utils.Account, utils.Subject}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", @@ -387,8 +387,8 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) { }, } eRply2 := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{utils.Subject, utils.Account}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{utils.Subject, utils.Account}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", @@ -453,8 +453,8 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) { t.Error("Unexpected reply returned", result) } eRply := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{"Account", "Subject"}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{"Account", "Subject"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", @@ -466,8 +466,8 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) { }, } eRply2 := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{utils.Subject, utils.Account}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{utils.Subject, utils.Account}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", @@ -531,8 +531,8 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) { t.Error("Unexpected reply returned", result) } eRply := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{"Account", "Subject"}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{"Account", "Subject"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", @@ -544,8 +544,8 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) { }, } eRply2 := &engine.AttrSProcessEventReply{ - MatchedProfile: "AttributeWithNonSubstitute", - AlteredFields: []string{utils.Subject, utils.Account}, + MatchedProfiles: []string{"AttributeWithNonSubstitute"}, + AlteredFields: []string{utils.Subject, utils.Account}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "testAttributeSWithNoneSubstitute", diff --git a/apier/v1/chargers_it_test.go b/apier/v1/chargers_it_test.go index 11782e876..32a8288c9 100755 --- a/apier/v1/chargers_it_test.go +++ b/apier/v1/chargers_it_test.go @@ -168,15 +168,15 @@ func testChargerSGetChargersForEvent(t *testing.T) { if err := chargerRPC.Call(utils.ChargerSv1GetChargersForEvent, chargerEvent[0], &result); err != nil { t.Error(err) } else if !reflect.DeepEqual(result, chargerProfiles) { - t.Errorf("Expecting : %s, received: %s", chargerProfiles, result) + t.Errorf("Expecting : %+v, received: %+v", chargerProfiles, result) } } func testChargerSProcessEvent(t *testing.T) { processedEv := &[]*engine.AttrSProcessEventReply{ &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_1001_SIMPLEAUTH", - AlteredFields: []string{"Password"}, + MatchedProfiles: []string{"ATTR_1001_SIMPLEAUTH"}, + AlteredFields: []string{"Password"}, CGREvent: &utils.CGREvent{ // matching Charger1 Tenant: "cgrates.org", ID: "event1", diff --git a/apier/v1/sessionsv1_it_test.go b/apier/v1/sessionsv1_it_test.go index 165d8580a..fdfc83172 100644 --- a/apier/v1/sessionsv1_it_test.go +++ b/apier/v1/sessionsv1_it_test.go @@ -183,8 +183,8 @@ func TestSSv1ItAuth(t *testing.T) { t.Errorf("expecting: %+v, received: %+v", utils.ToJSON(eSplrs), utils.ToJSON(rply.Suppliers)) } eAttrs := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_ACNT_1001", - AlteredFields: []string{"OfficeGroup"}, + MatchedProfiles: []string{"ATTR_ACNT_1001"}, + AlteredFields: []string{"OfficeGroup"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "TestSSv1ItAuth", @@ -288,8 +288,8 @@ func TestSSv1ItInitiateSession(t *testing.T) { t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation) } eAttrs := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_ACNT_1001", - AlteredFields: []string{"OfficeGroup"}, + MatchedProfiles: []string{"ATTR_ACNT_1001"}, + AlteredFields: []string{"OfficeGroup"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "TestSSv1ItInitiateSession", @@ -384,8 +384,8 @@ func TestSSv1ItUpdateSession(t *testing.T) { t.Error(err) } eAttrs := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_ACNT_1001", - AlteredFields: []string{"OfficeGroup"}, + MatchedProfiles: []string{"ATTR_ACNT_1001"}, + AlteredFields: []string{"OfficeGroup"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "TestSSv1ItUpdateSession", @@ -507,8 +507,8 @@ func TestSSv1ItProcessEvent(t *testing.T) { t.Errorf("Unexpected ResourceAllocation: %s", *rply.ResourceAllocation) } eAttrs := &engine.AttrSProcessEventReply{ - MatchedProfile: "ATTR_ACNT_1001", - AlteredFields: []string{"OfficeGroup"}, + MatchedProfiles: []string{"ATTR_ACNT_1001"}, + AlteredFields: []string{"OfficeGroup"}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", ID: "TestSSv1ItProcessEvent",