TestConnection

class TestConnection(expected: List<MockRoundTrip> = emptyList())

TestConnection implements aws.smithy.kotlin.runtime.http.engine.HttpClientEngine with canned responses. For each expected request it will capture the actual and respond with the pre-configured response (or a basic 200-OK with an empty body if none was configured).

After all requests/responses have been made use assertRequests to test that the actual requests captured match the expected.

NOTE: This engine is only capable of modeling request/response pairs. More complicated interactions such as duplex streaming are not implemented.

Constructors

Link copied to clipboard
constructor(expected: List<MockRoundTrip> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val config: <Error class: unknown class>

Functions

Link copied to clipboard
suspend fun assertRequests(asserter: CallAsserter = CallAsserter.FullyMatching)

Assert that each captured request matches the expected

Link copied to clipboard

Get the list of captured HTTP requests so far

Link copied to clipboard
open suspend fun roundTrip(context: <Error class: unknown class>, request: <Error class: unknown class>): <Error class: unknown class>