Mockk is a mocking library for Kotlin. Most of our Kotlin tests currently rely on Java Mockito to create mocks. We should migrate these tests to use Mockk instead.

This will fix many of the "Unchecked cast" warnings we get in the Kotlin tests:

Unchecked cast: AuthorizationRequestRepository<*>! to AuthorizationRequestRepository<OAuth2AuthorizationRequest>

For an example where we already use Mockk see KotlinEnableReactiveMethodSecurityTests.kt.

Comment From: theexiile1305

Added a pull request for fixing this issue #9839