RestClientInterpreter

data class RestClientInterpreter(val client: RestClient)(source)

Executes Tapik endpoints using a Spring RestClient while enforcing status and content-type checks.

Constructors

Link copied to clipboard
constructor(client: RestClient)

Properties

Link copied to clipboard
val client: RestClient

underlying RestClient instance.

Functions

Link copied to clipboard
fun send(method: Method, uri: URI, inputHeaders: Map<String, List<String>>, inputBodyContentType: MediaType?, inputBody: ByteArray?, outputs: List<Output<*, *>>): ResponseEntity<ByteArray>

Sends a request to the configured client and validates the response against the expected outputs.

Link copied to clipboard
fun statusHandler(output: Output<*, *>, method: Method, uri: URI): RestClient.ResponseSpec.ErrorHandler

Produces an error handler that verifies the response content type for output.

Link copied to clipboard
fun unmatchedStatusHandler(outputs: List<Output<*, *>>): ResponseErrorHandler

Produces a ResponseErrorHandler for statuses not matched by any declared outputs.