mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 07:38:45 +05:00
Replaced TenantIDWithOpts with TenantIDWithAPIOpts
This commit is contained in:
committed by
Dan Christian Bogos
parent
8b0748b139
commit
a6f41adaf9
@@ -750,16 +750,16 @@ type TenantID struct {
|
||||
ID string
|
||||
}
|
||||
|
||||
type TenantIDWithOpts struct {
|
||||
type TenantIDWithAPIOpts struct {
|
||||
*TenantID
|
||||
Opts map[string]interface{}
|
||||
APIOpts map[string]interface{}
|
||||
}
|
||||
|
||||
func (tID *TenantID) TenantID() string {
|
||||
return ConcatenatedKey(tID.Tenant, tID.ID)
|
||||
}
|
||||
|
||||
func (tID *TenantIDWithOpts) TenantIDConcatenated() string {
|
||||
func (tID *TenantIDWithAPIOpts) TenantIDConcatenated() string {
|
||||
return ConcatenatedKey(tID.Tenant, tID.ID)
|
||||
}
|
||||
|
||||
|
||||
@@ -1258,12 +1258,12 @@ func TestTenantID(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTenantIDWithCache(t *testing.T) {
|
||||
tID := &TenantIDWithOpts{TenantID: &TenantID{Tenant: EmptyString, ID: EmptyString}}
|
||||
tID := &TenantIDWithAPIOpts{TenantID: &TenantID{Tenant: EmptyString, ID: EmptyString}}
|
||||
eOut := ":"
|
||||
if rcv := tID.TenantID.TenantID(); rcv != eOut {
|
||||
t.Errorf("Expecting: %q, received: %q", eOut, rcv)
|
||||
}
|
||||
tID = &TenantIDWithOpts{TenantID: &TenantID{Tenant: "cgrates.org", ID: "id"}}
|
||||
tID = &TenantIDWithAPIOpts{TenantID: &TenantID{Tenant: "cgrates.org", ID: "id"}}
|
||||
eOut = "cgrates.org:id"
|
||||
if rcv := tID.TenantID.TenantID(); rcv != eOut {
|
||||
t.Errorf("Expecting: %q, received: %q", eOut, rcv)
|
||||
|
||||
Reference in New Issue
Block a user