respondsWithStatus

fun respondsWithStatus(statusCode: Int)(source)

Associates this stub with a body-free response carrying only an HTTP status code.

Example (Java):

mokksy.get(spec -> spec.path("/ping")).respondsWithStatus(204);

Parameters

statusCode

The HTTP status code to return (e.g. 204, 404).