withFailedTile

Adds a mock Tile that fails with the specified exception.

Return

This builder for method chaining

mosaicBuilder()
.withFailedTile(MyTile, RuntimeException("Test error"))
.withMosaic { /* compose and assert here */}

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

mosaicBuilder()
.withFailedTile(UserTile, RuntimeException("User not found"))
.withMosaic { /* compose and assert here */}

Parameters

tile

The MultiTile to mock

throwable

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