mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed MIssingStructField panic + index health test
This commit is contained in:
committed by
Dan Christian Bogos
parent
c385224171
commit
c6845687fa
@@ -37,6 +37,37 @@ func TestMissingStructFieldsCorrect(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMissingStructFieldsNilCorporate(t *testing.T) {
|
||||
tst := &TenantIDWithAPIOpts{
|
||||
APIOpts: map[string]interface{}{
|
||||
OptsAPIKey: "attr1234",
|
||||
},
|
||||
}
|
||||
if missing := MissingStructFields(tst,
|
||||
[]string{Tenant}); len(missing) != 1 {
|
||||
t.Errorf("TenantIDWithAPIOpts is missing from my struct: %v", missing)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMissingStructFieldsNilCorporateTwoStructs(t *testing.T) {
|
||||
tst := &struct {
|
||||
APIOpts map[string]interface{}
|
||||
*TenantID
|
||||
*TenantAccount
|
||||
}{
|
||||
APIOpts: map[string]interface{}{
|
||||
OptsAPIKey: "attr1234",
|
||||
},
|
||||
TenantID: &TenantID{
|
||||
Tenant: "cgrates.org",
|
||||
},
|
||||
}
|
||||
if missing := MissingStructFields(tst,
|
||||
[]string{Tenant}); len(missing) != 1 {
|
||||
t.Errorf("TenantIDWithAPIOpts is missing from my struct: %v", missing)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateStructWithIfaceMap(t *testing.T) {
|
||||
type myStruct struct {
|
||||
String string
|
||||
|
||||
Reference in New Issue
Block a user