onInvalidScope

override fun <T : Any, PutParams> onInvalidScope(key: ServiceKey<T, *, *, PutParams>, putParams: PutParams): ServiceEntry<T>

Called when getOrProvide is attempted for a specified key in a disallowed scope.

This implementation overrides the default behavior to create and return a MockEntry using createMockEntry.

Return

A ServiceEntry to be used as a fallback.

Parameters

key

The ServiceKey for which the provision was attempted.

putParams

The original parameters that would have been used for registration.