(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…