From a092820bb8d6c9f1201b63d3d1f31e723ff7089a Mon Sep 17 00:00:00 2001 From: "adam.lenkowski" Date: Fri, 15 Mar 2024 14:17:25 +0100 Subject: [PATCH] New test for testsuite.json 2.0 --- src/test/resources/jsonpatch/testsuite.json | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/test/resources/jsonpatch/testsuite.json b/src/test/resources/jsonpatch/testsuite.json index 9273334..9436850 100644 --- a/src/test/resources/jsonpatch/testsuite.json +++ b/src/test/resources/jsonpatch/testsuite.json @@ -1101,6 +1101,39 @@ } }, + { + "comment": "remove, test, and add nested fields", + "doc": { + "user": { + "credentials": { + "username": "user1", + "password": "pass123" + }, + "profile": { + "email": "user1@example.com", + "phone": "123-456-7890" + } + } + }, + "patch": [ + {"op": "remove", "path": "/user/credentials/password"}, + {"op": "test", "path": "/user/profile/email", "value": "user1@example.com"}, + {"op": "add", "path": "/user/profile/age", "value": 25} + ], + "expected": { + "user": { + "credentials": { + "username": "user1" + }, + "profile": { + "email": "user1@example.com", + "phone": "123-456-7890", + "age": 25 + } + } + } + }, + { "comment": "tests complete" }