-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,39 @@ func TestPathNotSpecifiedAdd(t *testing.T) { | |
expected map[string]interface{} | ||
expectedChanged bool | ||
}{ | ||
// Replace Multi Attribute | ||
{ | ||
name: "Add operation - Core Singular Attributes - add", | ||
op: scim.PatchOperation{ | ||
Op: "add", | ||
Value: map[string]interface{}{ | ||
"displayName": "Alice Green", | ||
"name": map[string]interface{}{ | ||
"familyName": "Green", | ||
}, | ||
"emails": []interface{}{ | ||
map[string]interface{}{ | ||
"type": "work", | ||
"value": "[email protected]", | ||
}, | ||
}, | ||
}, | ||
}, | ||
data: map[string]interface{}{}, | ||
expected: map[string]interface{}{ | ||
"displayName": "Alice Green", | ||
"name": map[string]interface{}{ | ||
"familyName": "Green", | ||
}, | ||
"emails": []interface{}{ | ||
map[string]interface{}{ | ||
"type": "work", | ||
"value": "[email protected]", | ||
}, | ||
}, | ||
}, | ||
expectedChanged: true, | ||
}, | ||
// Singular Attribute | ||
{ | ||
name: "Add operation - Core Singular Attributes - add", | ||
|
@@ -466,7 +499,7 @@ func TestPathNotSpecifiedAdd(t *testing.T) { | |
}, nil) | ||
|
||
// Apply the PatchOperation | ||
result, changed, err := patcher.Apply(context.TODO(),tc.op, tc.data) | ||
result, changed, err := patcher.Apply(context.TODO(), tc.op, tc.data) | ||
if err != nil { | ||
t.Fatalf("Apply() returned an unexpected error: %v", err) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,39 @@ func TestPathNotSpecifiedReplace(t *testing.T) { | |
expected map[string]interface{} | ||
expectedChanged bool | ||
}{ | ||
// Replace Multi Attribute | ||
{ | ||
name: "Replace operation - Core Singular Attributes - add", | ||
op: scim.PatchOperation{ | ||
Op: "replace", | ||
Value: map[string]interface{}{ | ||
"displayName": "Alice Green", | ||
"name": map[string]interface{}{ | ||
"familyName": "Green", | ||
}, | ||
"emails": []interface{}{ | ||
map[string]interface{}{ | ||
"type": "work", | ||
"value": "[email protected]", | ||
}, | ||
}, | ||
}, | ||
}, | ||
data: map[string]interface{}{}, | ||
expected: map[string]interface{}{ | ||
"displayName": "Alice Green", | ||
"name": map[string]interface{}{ | ||
"familyName": "Green", | ||
}, | ||
"emails": []interface{}{ | ||
map[string]interface{}{ | ||
"type": "work", | ||
"value": "[email protected]", | ||
}, | ||
}, | ||
}, | ||
expectedChanged: true, | ||
}, | ||
// Singular Attribute | ||
{ | ||
name: "Replace operation - Core Singular Attributes - add", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters