@@ -113,15 +113,15 @@ public void assertValue(String content, Object expectedValue) throws ParseExcept
113
113
@ SuppressWarnings ("rawtypes" )
114
114
List actualValueList = (List ) actualValue ;
115
115
if (actualValueList .isEmpty ()) {
116
- fail ("No matching value for JSON path \" " + this .expression + "\" " );
116
+ fail ("No matching value at JSON path \" " + this .expression + "\" " );
117
117
}
118
118
if (actualValueList .size () != 1 ) {
119
119
fail ("Got a list of values " + actualValue + " instead of the expected single value " + expectedValue );
120
120
}
121
121
actualValue = actualValueList .get (0 );
122
122
}
123
123
else if (actualValue != null && expectedValue != null ) {
124
- assertEquals ("For JSON path \" " + this .expression + "\" , type of value" ,
124
+ assertEquals ("At JSON path \" " + this .expression + "\" , type of value" ,
125
125
expectedValue .getClass ().getName (), actualValue .getClass ().getName ());
126
126
}
127
127
assertEquals ("JSON path \" " + this .expression + "\" " , expectedValue , actualValue );
@@ -135,7 +135,7 @@ else if (actualValue != null && expectedValue != null) {
135
135
*/
136
136
public void assertValueIsString (String content ) throws ParseException {
137
137
Object value = assertExistsAndReturn (content );
138
- String reason = "Expected string at JSON path \" " + this .expression + "\" but found " + value ;
138
+ String reason = "Expected a string at JSON path \" " + this .expression + "\" but found: " + value ;
139
139
assertThat (reason , value , instanceOf (String .class ));
140
140
}
141
141
@@ -147,7 +147,7 @@ public void assertValueIsString(String content) throws ParseException {
147
147
*/
148
148
public void assertValueIsBoolean (String content ) throws ParseException {
149
149
Object value = assertExistsAndReturn (content );
150
- String reason = "Expected boolean at JSON path \" " + this .expression + "\" but found " + value ;
150
+ String reason = "Expected a boolean at JSON path \" " + this .expression + "\" but found: " + value ;
151
151
assertThat (reason , value , instanceOf (Boolean .class ));
152
152
}
153
153
@@ -159,7 +159,7 @@ public void assertValueIsBoolean(String content) throws ParseException {
159
159
*/
160
160
public void assertValueIsNumber (String content ) throws ParseException {
161
161
Object value = assertExistsAndReturn (content );
162
- String reason = "Expected number at JSON path \" " + this .expression + "\" but found " + value ;
162
+ String reason = "Expected a number at JSON path \" " + this .expression + "\" but found: " + value ;
163
163
assertThat (reason , value , instanceOf (Number .class ));
164
164
}
165
165
@@ -170,7 +170,7 @@ public void assertValueIsNumber(String content) throws ParseException {
170
170
*/
171
171
public void assertValueIsArray (String content ) throws ParseException {
172
172
Object value = assertExistsAndReturn (content );
173
- String reason = "Expected array for JSON path \" " + this .expression + "\" but found " + value ;
173
+ String reason = "Expected an array at JSON path \" " + this .expression + "\" but found: " + value ;
174
174
assertTrue (reason , value instanceof List );
175
175
}
176
176
@@ -182,7 +182,7 @@ public void assertValueIsArray(String content) throws ParseException {
182
182
*/
183
183
public void assertValueIsMap (String content ) throws ParseException {
184
184
Object value = assertExistsAndReturn (content );
185
- String reason = "Expected map at JSON path \" " + this .expression + "\" but found " + value ;
185
+ String reason = "Expected a map at JSON path \" " + this .expression + "\" but found: " + value ;
186
186
assertThat (reason , value , instanceOf (Map .class ));
187
187
}
188
188
@@ -209,7 +209,7 @@ public void doesNotExist(String content) throws ParseException {
209
209
catch (AssertionError ex ) {
210
210
return ;
211
211
}
212
- String reason = String . format ( "Expected no value for JSON path: %s but found: %s" , this . expression , value ) ;
212
+ String reason = "Expected no value at JSON path \" " + this . expression + " \" but found: " + value ;
213
213
if (List .class .isInstance (value )) {
214
214
assertTrue (reason , ((List <?>) value ).isEmpty ());
215
215
}
@@ -219,7 +219,7 @@ public void doesNotExist(String content) throws ParseException {
219
219
}
220
220
221
221
private Object evaluateJsonPath (String content ) throws ParseException {
222
- String message = "No value for JSON path \" " + this .expression + "\" , exception: " ;
222
+ String message = "No value at JSON path \" " + this .expression + "\" , exception: " ;
223
223
try {
224
224
return this .jsonPath .read (content );
225
225
}
@@ -236,7 +236,7 @@ private Object evaluateJsonPath(String content) throws ParseException {
236
236
237
237
private Object assertExistsAndReturn (String content ) throws ParseException {
238
238
Object value = evaluateJsonPath (content );
239
- String reason = "No value for JSON path \" " + this .expression + "\" " ;
239
+ String reason = "No value at JSON path \" " + this .expression + "\" " ;
240
240
assertTrue (reason , value != null );
241
241
return value ;
242
242
}
0 commit comments