withMockTile
Adds a mock Tile that returns the specified response.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withMockTile(MyTile, "test data")
.build()Content copied to clipboard
Parameters
tile
The Tile to mock
response
The response to return when the tile is retrieved
Type Parameters
V
The type of data the tile returns
fun <K : Any, V> withMockTile(tile: MultiTile<K, V>, response: Map<K, V>): TestMosaicBuilder(source)
Adds a mock MultiTile that returns the specified responses for given keys.
Return
This builder for method chaining
val testMosaic = mosaicBuilder()
.withMockTile(UserTile, mapOf(
"user1" to User("user1"),
"user2" to User("user2")
))
.build()Content copied to clipboard
Parameters
tile
The Tile to mock
response
Map of keys to their corresponding values
Type Parameters
K
The type of keys in the response
V
The type of individual values in the response