withDelayedTile
Adds a mock Tile that delays before returning the response.
Return
This builder for method chaining
mosaicBuilder()
.withDelayedTile(MyTile, "delayed data", 1000) // 1 second delay
.withMosaic { /* compose and assert here */}Content copied to clipboard
Parameters
tile
The Tile to mock
response
The response to return after the delay
delayMs
The delay in milliseconds before returning the response
Type Parameters
V
The type of data the tile returns
fun <K : Any, V> withDelayedTile(tile: MultiTile<K, V>, response: Map<K, V>, delayMs: Long): TestMosaicBuilder(source)
Adds a mock MultiTile that delays before returning responses.
Return
This builder for method chaining
mosaicBuilder()
.withDelayedTile(UserTile, mapOf("user1" to User("user1")), 500)
.withMosaic { /* compose and assert here */}Content copied to clipboard
Parameters
tile
The MultiTile to mock
response
Map of keys to their corresponding values
delayMs
The delay in milliseconds before returning the response
Type Parameters
K
The type of keys in the response
V
The type of values in the response