I am trying to mock Spring JPA repository, but ins...
# getting-started
w
I am trying to mock Spring JPA repository, but instead get this... Error: Type inference failed: Not enough information to infer parameter
S
in
fun <S : Job!> saveAndFlush(p0: S!): S!
Copy code
interface JobRepository : JpaRepository<Job, Long>

val mockJobRepository: JobRepository = mock {
    on { saveAndFlush(any()) }.doReturn(Job(1, ""))
}
Could anyone, pls, help? How do I mock this correctly?