This repository was archived by the owner on Nov 7, 2024. It is now read-only.

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ static String _MOVE_TARGET_NULL(String from) {
269269
return localize(".move.target.null", from);
270270
}
271271

272-
static String _TEST_FAILED() {
273-
return localize(".test.failed");
272+
static String _TEST_FAILED(String path, String value) {
273+
return localize(".test.failed", path, value);
274274
}
275275

276276
static String _ILLEGAL_OPERATION(String operation) {
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private JsonStructure apply(JsonStructure target, JsonObject operation) {
193193
return pointer.add(from.remove(target), from.getValue(target));
194194
case TEST:
195195
if (! getValue(operation).equals(pointer.getValue(target))) {
196-
throw new JsonException(JsonMessages._TEST_FAILED());
196+
throw new JsonException(JsonMessages._TEST_FAILED(operation.getString("path"), getValue(operation).toString()));
197197
}
198198
return target;
199199
default:
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ noderef.array.index.err=An array item index is out of range. Index: {0}, Size: {
107107
.must.be.array=A JSON must be an array of JSON Objects
108108
.move.proper.prefix=The ''{0}'' path of the operation ''move'' is a proper prefix of the ''{1}'' path
109109
.move.target.null=The ''{0}'' path of the operation ''move'' does not exist in target object
110-
.test.failed=The JSON operation ''test'' failed
110+
.test.failed=The JSON operation ''test'' failed for path ''{0}'' and value ''{1}''
111111
.illegal.operation=Illegal value for the op member of the JSON operation: ''{0}''
112112
.member.missing=The JSON operation ''{0}'' must contain a ''{1}'' member

0 commit comments

Comments
 (0)