withCanvasSource
Borrows a caller-owned source for the canvas with the specified class and object. Allows for passing in a superclass as the retrieval type.
Return
This builder for method chaining
mosaicBuilder()
.withCanvasSource(User::class, User("test-user"))
.withMockTile(MyTile, "test data")
.withMosaic { /* compose and assert here */}Parameters
The class of the object to register
The object to register
Borrows a caller-owned source for the canvas with the specified object.
Return
This builder for method chaining
mosaicBuilder()
.withCanvasSource(User("test-user"))
.withMockTile(MyTile, "test data")
.withMosaic { /* compose and assert here */}Parameters
The object to register
Borrows a caller-owned source for the canvas with the specified class, qualifier, and object.
Return
This builder for method chaining
mosaicBuilder()
.withCanvasSource(DatabaseService::class, "primary", primaryDb)
.withCanvasSource(DatabaseService::class, "secondary", secondaryDb)
.withMosaic { /* compose and assert here */}Parameters
The class of the object to register
The qualifier to distinguish this instance
The object to register
Borrows a caller-owned source for the canvas with the specified object and qualifier.
Return
This builder for method chaining
mosaicBuilder()
.withCanvasSource("primary", primaryDb)
.withCanvasSource("secondary", secondaryDb)
.withMosaic { /* compose and assert here */}Parameters
The qualifier to distinguish this instance
The object to register
Borrows a caller-owned source for the canvas using a CanvasKey.
Return
This builder for method chaining
val dbKey = CanvasKey(DatabaseService::class, "primary")
mosaicBuilder()
.withCanvasSource(dbKey, primaryDb)
.withMosaic { /* compose and assert here */}Parameters
The canvas key to register under
The object to register