withFailedTile

Adds a mock Tile that fails with the specified exception.

Return

This builder for method chaining

val testMosaic = mosaicBuilder()
.withFailedTile(MyTile, RuntimeException("Test error"))
.build()

Parameters

tile

The Tile to mock

throwable

The exception to throw when the tile is retrieved


@JvmName(name = "withFailedMultiTile")
fun withFailedTile(tile: MultiTile<*, *>, throwable: Throwable): TestMosaicBuilder(source)

Adds a mock MultiTile that fails with the specified exception.

Return

This builder for method chaining

val testMosaic = mosaicBuilder()
.withFailedTile(UserTile, RuntimeException("User not found"))
.build()

Parameters

K

The type of keys in the response

tile

The Tile to mock

throwable

The exception to throw when the tile's methods are called