MCPcopy Create free account
hub / github.com/elimity-com/scim / TestOperationValidator_getRefSubAttribute

Function TestOperationValidator_getRefSubAttribute

internal/patch/patch_test.go:72–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestOperationValidator_getRefSubAttribute(t *testing.T) {
73 for _, test := range []struct {
74 attributeName string
75 subAttributeName string
76 }{
77 {`name`, `givenName`},
78 {`groups`, `display`},
79 } {
80 validator, err := NewValidator(
81 fmt.Sprintf(`{"op":"invalid","path":%q,"value":"value"}`, test.attributeName),
82 schema.CoreUserSchema(), schema.ExtensionEnterpriseUser(),
83 )
84 if err != nil {
85 t.Fatal(err)
86 }
87 refAttr, ok := schema.CoreUserSchema().Attributes.ContainsAttribute(test.attributeName)
88 if !ok {
89 t.Fatal()
90 }
91 attr, err := validator.getRefSubAttribute(&refAttr, test.subAttributeName)
92 if err != nil {
93 t.Fatal(err)
94 }
95 if name := attr.Name(); name != test.subAttributeName {
96 t.Errorf("expected %s, got %s", test.subAttributeName, name)
97 }
98 }
99}

Callers

nothing calls this directly

Calls 6

CoreUserSchemaFunction · 0.92
ExtensionEnterpriseUserFunction · 0.92
ContainsAttributeMethod · 0.80
getRefSubAttributeMethod · 0.80
NameMethod · 0.80
NewValidatorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…