Java Request Specification Builder
Java-friendly wrapper around RequestSpecificationBuilder that replaces Kotlin functional types with their java.util.function equivalents.
Java callers receive this type from dev.mokksy.Mokksy's stub-registration methods (get, post, etc.) and use it to configure request-matching criteria.
All methods return this for fluent chaining:
mokksy.post(spec -> spec
.path("/items")
.bodyMatchesPredicate(body -> body.contains("token")))
.respondsWith(builder -> builder.body("ok"));Type Parameters
The type of the request payload.
Functions
Configures body matching through a JavaBodySpecBuilder scope.
Requires the request body string to contain all of strings.
Adds a predicate to match against the deserialized request body.
Adds a predicate to match against the deserialized request body, with a description.
Matches the request body string exactly against expectedValue.
Matches the request body string against a Predicate.
Matches the request body string against a Predicate, with a description.
Requires that the request does not contain a cookie with name.
Matches the request path using a Kotest Matcher.
Matches the request path exactly against path.
Sets the priority for this stub. Higher values win over lower values.