vlsi commented on code in PR #5717:
URL: https://github.com/apache/jmeter/pull/5717#discussion_r1008671507


##########
src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java:
##########
@@ -137,15 +137,15 @@ private void doAssert(String jsonString) {
         }
 
         if (isExpectNull()) {
-            throw new IllegalStateException(String.format("Value expected to 
be null, but found '%s'", value));
+            throw new IllegalStateException(String.format("Value in json path 
'%s' expected to be null, but found '%s'", getJsonPath(), value));

Review Comment:
   Should `value` be `objectToString(value)` like below?



##########
src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java:
##########
@@ -118,8 +118,8 @@ private void doAssert(String jsonString) {
             if (value instanceof JSONArray) {
                 JSONArray arrayValue = (JSONArray) value;
                 if (arrayValue.isEmpty() && 
!JsonPath.isPathDefinite(getJsonPath())) {
-                    throw new IllegalStateException("JSONPath is indefinite 
and the extracted Value is an empty Array." +
-                            " Please use an assertion value, to be sure to get 
a correct result. " + getExpectedValue());
+                    throw new IllegalStateException(String.format("JSONPath 
'%s' is indefinite and the extracted Value is an empty Array." +
+                            " Please use an assertion value, to be sure to get 
a correct result. '%s'", getJsonPath(), getExpectedValue()));

Review Comment:
   ```suggestion
                               " Please use an assertion value, to be sure to 
get a correct result. Expected value was '%s'", getJsonPath(), 
getExpectedValue()));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to