mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add Integration test for ResourceSv1GetResourceWithConfig
This commit is contained in:
committed by
Dan Christian Bogos
parent
c2a21365aa
commit
311d01861d
@@ -51,6 +51,7 @@ var (
|
||||
testV1RsCacheResourceBeforeLoad,
|
||||
testV1RsFromFolder,
|
||||
testV1RsCacheResourceAfterLoad,
|
||||
testV1RsCacheResourceWithConfig,
|
||||
testV1RsGetResourcesForEvent,
|
||||
testV1RsTTL0,
|
||||
testV1RsAllocateResource,
|
||||
@@ -195,6 +196,42 @@ func testV1RsCacheResourceAfterLoad(t *testing.T) { // the APIerSv1LoadTariffPla
|
||||
}
|
||||
}
|
||||
|
||||
func testV1RsCacheResourceWithConfig(t *testing.T) {
|
||||
var rplyRes *engine.ResourceWithConfig
|
||||
|
||||
expRes := &engine.ResourceWithConfig{
|
||||
Resource: &engine.Resource{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "ResGroup1",
|
||||
Usages: map[string]*engine.ResourceUsage{},
|
||||
TTLIdx: nil,
|
||||
},
|
||||
Config: &engine.ResourceProfile{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "ResGroup1",
|
||||
FilterIDs: []string{"FLTR_1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 07, 29, 15, 0, 0, 0, time.UTC),
|
||||
ExpiryTime: time.Date(0001, 01, 01, 0, 0, 0, 0, time.UTC),
|
||||
},
|
||||
UsageTTL: 1000000000,
|
||||
Limit: 7,
|
||||
AllocationMessage: "",
|
||||
Blocker: false,
|
||||
Stored: false,
|
||||
Weight: 20,
|
||||
ThresholdIDs: []string{"*none"},
|
||||
},
|
||||
}
|
||||
if err := rlsV1Rpc.Call(utils.ResourceSv1GetResourceWithConfig, &utils.TenantIDWithAPIOpts{
|
||||
TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "ResGroup1"},
|
||||
}, &rplyRes); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(expRes, rplyRes) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(expRes), utils.ToJSON(rplyRes))
|
||||
}
|
||||
}
|
||||
|
||||
func testV1RsFromFolder(t *testing.T) {
|
||||
var reply string
|
||||
attrs := &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, "tariffplans", "oldtutorial")}
|
||||
|
||||
Reference in New Issue
Block a user