@@ -208,78 +208,78 @@ interface Response extends Traversable {
208
208
}
209
209
210
210
/**
211
- * Declare options available to assert data at a given path.
211
+ * Options available to assert the response values at the current path.
212
212
*/
213
213
interface Path extends Traversable {
214
214
215
215
/**
216
- * Assert the given path exists, even if the value is {@code null}.
217
- * @return spec to assert the converted entity with
216
+ * Verify the given path exists, even if the value is {@code null}.
217
+ * @return the same {@code Path} spec for further assertions
218
218
*/
219
219
Path pathExists ();
220
220
221
221
/**
222
222
* Assert the given path does not {@link #pathExists() exist}.
223
- * @return spec to assert the converted entity with
223
+ * @return the same {@code Path} spec for further assertions
224
224
*/
225
225
Path pathDoesNotExist ();
226
226
227
227
/**
228
228
* Assert a value exists at the given path where the value is any {@code non-null}
229
229
* value, possibly an empty array or map.
230
- * @return spec to assert the converted entity with
230
+ * @return the same {@code Path} spec for further assertions
231
231
*/
232
232
Path valueExists ();
233
233
234
234
/**
235
235
* Assert a value does not {@link #valueExists() exist} at the given path.
236
- * @return spec to assert the converted entity with
236
+ * @return the same {@code Path} spec for further assertions
237
237
*/
238
238
Path valueDoesNotExist ();
239
239
240
240
/**
241
241
* Assert the value at the given path does exist but is empty as defined
242
242
* in {@link org.springframework.util.ObjectUtils#isEmpty(Object)}.
243
- * @return spec to assert the converted entity with
243
+ * @return the same {@code Path} spec for further assertions
244
244
* @see org.springframework.util.ObjectUtils#isEmpty(Object)
245
245
*/
246
246
Path valueIsEmpty ();
247
247
248
248
/**
249
249
* Assert the value at the given path is not {@link #valueIsEmpty() empty}.
250
- * @return spec to assert the converted entity with
250
+ * @return the same {@code Path} spec for further assertions
251
251
*/
252
252
Path valueIsNotEmpty ();
253
253
254
254
/**
255
255
* Convert the data at the given path to the target type.
256
256
* @param entityType the type to convert to
257
257
* @param <D> the target entity type
258
- * @return spec to assert the converted entity with
258
+ * @return an {@code Entity} spec to verify the decoded value with
259
259
*/
260
260
<D > Entity <D , ?> entity (Class <D > entityType );
261
261
262
262
/**
263
263
* Convert the data at the given path to the target type.
264
264
* @param entityType the type to convert to
265
265
* @param <D> the target entity type
266
- * @return spec to assert the converted entity with
266
+ * @return an {@code Entity} spec to verify the decoded value with
267
267
*/
268
268
<D > Entity <D , ?> entity (ParameterizedTypeReference <D > entityType );
269
269
270
270
/**
271
271
* Convert the data at the given path to a List of the target type.
272
272
* @param elementType the type of element to convert to
273
273
* @param <D> the target entity type
274
- * @return spec to assert the converted List of entities with
274
+ * @return an {@code EntityList} spec to verify the decoded values with
275
275
*/
276
276
<D > EntityList <D > entityList (Class <D > elementType );
277
277
278
278
/**
279
279
* Convert the data at the given path to a List of the target type.
280
280
* @param elementType the type to convert to
281
281
* @param <D> the target entity type
282
- * @return spec to assert the converted List of entities with
282
+ * @return an {@code EntityList} spec to verify the decoded values with
283
283
*/
284
284
<D > EntityList <D > entityList (ParameterizedTypeReference <D > elementType );
285
285
@@ -291,7 +291,7 @@ interface Path extends Traversable {
291
291
* <a href="https://jsonassert.skyscreamer.org/">JSONassert</a> library on to be
292
292
* on the classpath.
293
293
* @param expectedJson the expected JSON
294
- * @return spec to specify a different path
294
+ * @return {@code Traversable} spec to select a different path
295
295
* @see org.springframework.test.util.JsonExpectationsHelper#assertJsonEqual(String,
296
296
* String)
297
297
*/
@@ -303,7 +303,7 @@ interface Path extends Traversable {
303
303
* of formatting, along with lenient checking, e.g. extensible and non-strict
304
304
* array ordering.
305
305
* @param expectedJson the expected JSON
306
- * @return spec to specify a different path
306
+ * @return {@code Traversable} spec to select a different path
307
307
* @see org.springframework.test.util.JsonExpectationsHelper#assertJsonEqual(String,
308
308
* String, boolean)
309
309
*/
@@ -312,121 +312,114 @@ interface Path extends Traversable {
312
312
}
313
313
314
314
/**
315
- * Declare options available to assert data converted to an entity.
315
+ * Contains a decoded entity and provides options to assert it
316
316
*
317
317
* @param <D> the entity type
318
- * @param <S> the spec type, including subtypes
318
+ * @param <S> the {@code Entity} spec type
319
319
*/
320
320
interface Entity <D , S extends Entity <D , S >> extends Traversable {
321
321
322
322
/**
323
- * Assert the converted entity equals the given Object.
324
- * @param expected the expected Object
325
- * @param <T> the spec type
326
- * @return the same spec for more assertions
323
+ * Verify the decoded entity is equal to the given value.
324
+ * @param expected the expected value
325
+ * @return the {@code Entity} spec for further assertions
327
326
*/
328
327
<T extends S > T isEqualTo (Object expected );
329
328
330
329
/**
331
- * Assert the converted entity does not equal the given Object.
332
- * @param other the Object to check against
333
- * @param <T> the spec type
334
- * @return the same spec for more assertions
330
+ * Verify the decoded entity is not equal to the given value.
331
+ * @param other the value to check against
332
+ * @return the {@code Entity} spec for further assertions
335
333
*/
336
334
<T extends S > T isNotEqualTo (Object other );
337
335
338
336
/**
339
- * Assert the converted entity is the same instance as the given Object.
340
- * @param expected the expected Object
341
- * @param <T> the spec type
342
- * @return the same spec for more assertions
337
+ * Verify the decoded entity is the same instance as the given value.
338
+ * @param expected the expected value
339
+ * @return the {@code Entity} spec for further assertions
343
340
*/
344
341
<T extends S > T isSameAs (Object expected );
345
342
346
343
/**
347
- * Assert the converted entity is not the same instance as the given Object.
348
- * @param other the Object to check against
349
- * @param <T> the spec type
350
- * @return the same spec for more assertions
344
+ * Verify the decoded entity is not the same instance as the given value.
345
+ * @param other the value to check against
346
+ * @return the {@code Entity} spec for further assertions
351
347
*/
352
348
<T extends S > T isNotSameAs (Object other );
353
349
354
350
/**
355
- * Assert the converted entity matches the given predicate.
356
- * @param predicate the expected Object
357
- * @param <T> the spec type
358
- * @return the same spec for more assertions
351
+ * Verify the decoded entity matches the given predicate.
352
+ * @param predicate the predicate to apply
353
+ * @return the {@code Entity} spec for further assertions
359
354
*/
360
355
<T extends S > T matches (Predicate <D > predicate );
361
356
362
357
/**
363
- * Perform any assertions on the converted entity, e.g. via AssertJ.
364
- * @param consumer the consumer to inspect the entity with
365
- * @param <T> the spec type
366
- * @return the same spec for more assertions
358
+ * Verify the entity with the given {@link Consumer}.
359
+ * @param consumer the consumer to apply
360
+ * @return the {@code Entity} spec for further assertions
367
361
*/
368
362
<T extends S > T satisfies (Consumer <D > consumer );
369
363
370
364
/**
371
- * Return the converted entity.
372
- * @return the converter entity
365
+ * Return the decoded entity value(s).
373
366
*/
374
367
D get ();
375
368
376
369
}
377
370
378
371
/**
379
- * Extension of {@link Entity} with options available to assert data converted to
380
- * a List of entities.
372
+ * Contains a List of decoded entities and provides options to assert them.
381
373
*
382
374
* @param <E> the type of elements in the list
383
375
*/
384
376
interface EntityList <E > extends Entity <List <E >, EntityList <E >> {
385
377
386
378
/**
387
- * Assert the list contains the given elements .
388
- * @param elements values that are expected
389
- * @return the same spec for more assertions
379
+ * Verify the list contains the given values, in any order .
380
+ * @param values values that are expected
381
+ * @return the {@code EntityList} spec for further assertions
390
382
*/
391
383
@ SuppressWarnings ("unchecked" )
392
- EntityList <E > contains (E ... elements );
384
+ EntityList <E > contains (E ... values );
393
385
394
386
/**
395
- * Assert the list does not contain the given elements .
396
- * @param elements values that are not expected
397
- * @return the same spec for more assertions
387
+ * Verify the list does not contain the given values .
388
+ * @param values the values that are not expected
389
+ * @return the {@code EntityList} spec for further assertions
398
390
*/
399
391
@ SuppressWarnings ("unchecked" )
400
- EntityList <E > doesNotContain (E ... elements );
392
+ EntityList <E > doesNotContain (E ... values );
401
393
402
394
/**
403
- * Assert the list contains the given elements.
404
- * @param elements values that are expected
405
- * @return the same spec for more assertions
395
+ * Verify that the list contains exactly the given values and nothing
396
+ * else, in the same order.
397
+ * @param values the expected values
398
+ * @return the {@code EntityList} spec for further assertions
406
399
*/
407
400
@ SuppressWarnings ("unchecked" )
408
- EntityList <E > containsExactly (E ... elements );
401
+ EntityList <E > containsExactly (E ... values );
409
402
410
403
/**
411
- * Assert the list contains the specified number of elements .
412
- * @param size the number of elements expected
413
- * @return the same spec for more assertions
404
+ * Verify the number of values in the list .
405
+ * @param size the expected size
406
+ * @return the {@code EntityList} spec for further assertions
414
407
*/
415
408
EntityList <E > hasSize (int size );
416
409
417
410
/**
418
- * Assert the list contains fewer elements than the specified number.
419
- * @param boundary the number to compare the number of elements to
420
- * @return the same spec for more assertions
411
+ * Verify the list has fewer than the number of values .
412
+ * @param size the number to compare the actual size to
413
+ * @return the {@code EntityList} spec for further assertions
421
414
*/
422
- EntityList <E > hasSizeLessThan (int boundary );
415
+ EntityList <E > hasSizeLessThan (int size );
423
416
424
417
/**
425
- * Assert the list contains more elements than the specified number.
426
- * @param boundary the number to compare the number of elements to
427
- * @return the same spec for more assertions
418
+ * Verify the list has more than the specified number of values .
419
+ * @param size the number to compare the actual size to
420
+ * @return the {@code EntityList} spec for further assertions
428
421
*/
429
- EntityList <E > hasSizeGreaterThan (int boundary );
422
+ EntityList <E > hasSizeGreaterThan (int size );
430
423
431
424
}
432
425
0 commit comments