mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update name from tariffplans tutorial from Supplier to Route
This commit is contained in:
committed by
Dan Christian Bogos
parent
94aaf07819
commit
d240913556
@@ -409,7 +409,7 @@ func testInternalRemoteITGetRoute(t *testing.T) {
|
||||
var reply *engine.RouteProfile
|
||||
splPrf := &engine.RouteProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SPL_ACNT_1001",
|
||||
ID: "ROUTE_ACNT_1001",
|
||||
FilterIDs: []string{"FLTR_ACNT_1001"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2017, 11, 27, 0, 0, 0, 0, time.UTC),
|
||||
@@ -418,20 +418,20 @@ func testInternalRemoteITGetRoute(t *testing.T) {
|
||||
SortingParameters: []string{},
|
||||
Routes: []*engine.Route{
|
||||
{
|
||||
ID: "supplier1",
|
||||
ID: "route1",
|
||||
Weight: 10,
|
||||
},
|
||||
{
|
||||
ID: "supplier2",
|
||||
ID: "route2",
|
||||
Weight: 20,
|
||||
},
|
||||
},
|
||||
Weight: 20,
|
||||
}
|
||||
// supplier in reverse order
|
||||
// routeProfile in reverse order
|
||||
splPrf2 := &engine.RouteProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SPL_ACNT_1001",
|
||||
ID: "ROUTE_ACNT_1001",
|
||||
FilterIDs: []string{"FLTR_ACNT_1001"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2017, 11, 27, 0, 0, 0, 0, time.UTC),
|
||||
@@ -440,11 +440,11 @@ func testInternalRemoteITGetRoute(t *testing.T) {
|
||||
SortingParameters: []string{},
|
||||
Routes: []*engine.Route{
|
||||
{
|
||||
ID: "supplier2",
|
||||
ID: "route2",
|
||||
Weight: 20,
|
||||
},
|
||||
{
|
||||
ID: "supplier1",
|
||||
ID: "route1",
|
||||
Weight: 10,
|
||||
},
|
||||
},
|
||||
@@ -456,7 +456,7 @@ func testInternalRemoteITGetRoute(t *testing.T) {
|
||||
}
|
||||
|
||||
if err := internalRPC.Call(utils.APIerSv1GetRouteProfile,
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "SPL_ACNT_1001"}, &reply); err != nil {
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ROUTE_ACNT_1001"}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(splPrf, reply) && !reflect.DeepEqual(splPrf2, reply) {
|
||||
t.Errorf("Expecting: %+v, \n received: %+v", utils.ToJSON(splPrf), utils.ToJSON(reply))
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Tenant,ID,FilterIDs,ActivationInterval,Sorting,SortingParameters,RouteID,RouteFilterIDs,RouteAccountIDs,RouteRatingPlanIDs,RouteResourceIDs,RouteStatIDs,RouteWeight,RouteBlocker,RouteParameters,Weight
|
||||
cgrates.org,SPL_ACNT_1001,FLTR_ACNT_1001,2017-11-27T00:00:00Z,*weight,,supplier1,,,,,,10,,,10
|
||||
cgrates.org,SPL_ACNT_1001,,,,,supplier2,,,,,,20,,,20
|
||||
cgrates.org,SPL_ACNT_1002,FLTR_ACNT_1002,2017-11-27T00:00:00Z,*lc,,supplier1,,,RP_1002_LOW,,,10,false,,10
|
||||
cgrates.org,SPL_ACNT_1002,,,,,supplier2,,,RP_1002,,,20,,,
|
||||
cgrates.org,SPL_ACNT_1003,FLTR_ACNT_1003,2017-11-27T00:00:00Z,*qos,*tcc;*tcd,supplier1,,,,,Stats2,10,false,,10
|
||||
cgrates.org,SPL_ACNT_1003,,,,,supplier2,,,,,Stats2_1,20,,,
|
||||
cgrates.org,ROUTE_ACNT_1001,FLTR_ACNT_1001,2017-11-27T00:00:00Z,*weight,,route1,,,,,,10,,,10
|
||||
cgrates.org,ROUTE_ACNT_1001,,,,,route2,,,,,,20,,,20
|
||||
cgrates.org,ROUTE_ACNT_1002,FLTR_ACNT_1002,2017-11-27T00:00:00Z,*lc,,route1,,,RP_1002_LOW,,,10,false,,10
|
||||
cgrates.org,ROUTE_ACNT_1002,,,,,route2,,,RP_1002,,,20,,,
|
||||
cgrates.org,ROUTE_ACNT_1003,FLTR_ACNT_1003,2017-11-27T00:00:00Z,*qos,*tcc;*tcd,route1,,,,,Stats2,10,false,,10
|
||||
cgrates.org,ROUTE_ACNT_1003,,,,,route2,,,,,Stats2_1,20,,,
|
||||
|
||||
|
||||
|
@@ -140,12 +140,12 @@ func testDspSupGetSupFailover(t *testing.T) {
|
||||
},
|
||||
}
|
||||
eRpl := &engine.SortedRoutes{
|
||||
ProfileID: "SPL_ACNT_1002",
|
||||
ProfileID: "ROUTE_ACNT_1002",
|
||||
Sorting: utils.MetaLC,
|
||||
Count: 2,
|
||||
SortedRoutes: []*engine.SortedRoute{
|
||||
{
|
||||
RouteID: "supplier1",
|
||||
RouteID: "route1",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.3166,
|
||||
@@ -154,7 +154,7 @@ func testDspSupGetSupFailover(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
RouteID: "supplier2",
|
||||
RouteID: "route2",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.6334,
|
||||
@@ -229,12 +229,12 @@ func testDspSupTestAuthKey(t *testing.T) {
|
||||
func testDspSupTestAuthKey2(t *testing.T) {
|
||||
var rpl *engine.SortedRoutes
|
||||
eRpl := &engine.SortedRoutes{
|
||||
ProfileID: "SPL_ACNT_1002",
|
||||
ProfileID: "ROUTE_ACNT_1002",
|
||||
Sorting: utils.MetaLC,
|
||||
Count: 2,
|
||||
SortedRoutes: []*engine.SortedRoute{
|
||||
{
|
||||
RouteID: "supplier1",
|
||||
RouteID: "route1",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.3166,
|
||||
@@ -243,7 +243,7 @@ func testDspSupTestAuthKey2(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
RouteID: "supplier2",
|
||||
RouteID: "route2",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.6334,
|
||||
@@ -297,12 +297,12 @@ func testDspSupGetSupRoundRobin(t *testing.T) {
|
||||
},
|
||||
}
|
||||
eRpl := &engine.SortedRoutes{
|
||||
ProfileID: "SPL_ACNT_1002",
|
||||
ProfileID: "ROUTE_ACNT_1002",
|
||||
Sorting: utils.MetaLC,
|
||||
Count: 2,
|
||||
SortedRoutes: []*engine.SortedRoute{
|
||||
{
|
||||
RouteID: "supplier1",
|
||||
RouteID: "route1",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.3166,
|
||||
@@ -311,7 +311,7 @@ func testDspSupGetSupRoundRobin(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
RouteID: "supplier2",
|
||||
RouteID: "route2",
|
||||
RouteParameters: "",
|
||||
SortingData: map[string]interface{}{
|
||||
utils.Cost: 0.6334,
|
||||
@@ -374,7 +374,7 @@ func testDspSupGetSupplierForEvent(t *testing.T) {
|
||||
}
|
||||
expected := engine.RouteProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SPL_ACNT_1002",
|
||||
ID: "ROUTE_ACNT_1002",
|
||||
FilterIDs: []string{"FLTR_ACNT_1002"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2017, 11, 27, 00, 00, 00, 00, time.UTC),
|
||||
@@ -383,7 +383,7 @@ func testDspSupGetSupplierForEvent(t *testing.T) {
|
||||
SortingParameters: []string{},
|
||||
Routes: []*engine.Route{
|
||||
&engine.Route{
|
||||
ID: "supplier1",
|
||||
ID: "route1",
|
||||
FilterIDs: nil,
|
||||
AccountIDs: nil,
|
||||
RatingPlanIDs: []string{"RP_1002_LOW"},
|
||||
@@ -394,7 +394,7 @@ func testDspSupGetSupplierForEvent(t *testing.T) {
|
||||
RouteParameters: "",
|
||||
},
|
||||
&engine.Route{
|
||||
ID: "supplier2",
|
||||
ID: "route2",
|
||||
FilterIDs: nil,
|
||||
AccountIDs: nil,
|
||||
RatingPlanIDs: []string{"RP_1002"},
|
||||
|
||||
@@ -347,7 +347,7 @@ func testExpVerifyRoutes(t *testing.T) {
|
||||
var reply *engine.RouteProfile
|
||||
splPrf := &engine.RouteProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SPL_ACNT_1002",
|
||||
ID: "ROUTE_ACNT_1002",
|
||||
FilterIDs: []string{"FLTR_ACNT_1002"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2017, 11, 27, 0, 0, 0, 0, time.UTC),
|
||||
@@ -356,14 +356,14 @@ func testExpVerifyRoutes(t *testing.T) {
|
||||
SortingParameters: []string{},
|
||||
Routes: []*engine.Route{
|
||||
{
|
||||
ID: "supplier1",
|
||||
ID: "route1",
|
||||
RatingPlanIDs: []string{"RP_1002_LOW"},
|
||||
Weight: 10,
|
||||
Blocker: false,
|
||||
RouteParameters: utils.EmptyString,
|
||||
},
|
||||
{
|
||||
ID: "supplier2",
|
||||
ID: "route2",
|
||||
RatingPlanIDs: []string{"RP_1002"},
|
||||
Weight: 20,
|
||||
Blocker: false,
|
||||
@@ -375,7 +375,7 @@ func testExpVerifyRoutes(t *testing.T) {
|
||||
|
||||
splPrf2 := &engine.RouteProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SPL_ACNT_1002",
|
||||
ID: "ROUTE_ACNT_1002",
|
||||
FilterIDs: []string{"FLTR_ACNT_1002"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2017, 11, 27, 0, 0, 0, 0, time.UTC),
|
||||
@@ -384,14 +384,14 @@ func testExpVerifyRoutes(t *testing.T) {
|
||||
SortingParameters: []string{},
|
||||
Routes: []*engine.Route{
|
||||
{
|
||||
ID: "supplier2",
|
||||
ID: "route2",
|
||||
RatingPlanIDs: []string{"RP_1002"},
|
||||
Weight: 20,
|
||||
Blocker: false,
|
||||
RouteParameters: utils.EmptyString,
|
||||
},
|
||||
{
|
||||
ID: "supplier1",
|
||||
ID: "route1",
|
||||
RatingPlanIDs: []string{"RP_1002_LOW"},
|
||||
Weight: 10,
|
||||
Blocker: false,
|
||||
@@ -401,7 +401,7 @@ func testExpVerifyRoutes(t *testing.T) {
|
||||
Weight: 10,
|
||||
}
|
||||
if err := expRpc.Call(utils.APIerSv1GetRouteProfile,
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "SPL_ACNT_1002"}, &reply); err != nil {
|
||||
&utils.TenantID{Tenant: "cgrates.org", ID: "ROUTE_ACNT_1002"}, &reply); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if *encoding == utils.MetaGOB {
|
||||
|
||||
Reference in New Issue
Block a user