MockGlideBuilders

class MockGlideBuilders

Mocks for various builder patterns in Glide to make testing easier.

All methods share the same behavior. Any method on the builder that returns the builder itself will default to returning the mock rather than null. Any method on the builder that returns anything other than the builder will return Mockito's standard default return value.

Functions

Link copied to clipboard
open fun <T : RequestOptions?> mockGlideOptions(glideOptionsClass: Class<T>): T
Creates a new instance of a generated GlideOptions class for an application.
Link copied to clipboard
open fun <T, Y : RequestBuilder<T>?> mockGlideRequest(glideRequest: Class<out Any>): Y
Creates a new instance of a generated GlideRequest class for an application.
Link copied to clipboard
open fun <T> mockRequestBuilder(): RequestBuilder<T>
Creates a new RequestBuilder instance with a matching resource type.
Link copied to clipboard
open fun mockRequestOptions(): RequestOptions
Creates a new RequestOptions instance.