body Matches Predicate
Adds a predicate to match against the deserialized request body.
Unlike the Kotlin overload, this method accepts a Predicate so Java callers can pass a lambda directly without dealing with Function1 SAM types.
Return
This builder instance.
Parameters
predicate
A Predicate applied to the deserialized body, which is guaranteed non-null.
fun bodyMatchesPredicate(description: String?, predicate: Predicate<P>): JavaRequestSpecificationBuilder<P>(source)
Adds a predicate to match against the deserialized request body, with a description.
Return
This builder instance.
Parameters
description
Human-readable label shown in mismatch reports.
predicate
A Predicate applied to the deserialized body, which is guaranteed non-null.