:wave: hello all, I have a question regarding moc...
# mockk
j
👋 hello all, I have a question regarding mocking a data class (jpa entity in my case) and using the mocked properties inside an instance method. It’s probably best explained using an example:
Copy code
data class Entity (val a: Int, val b: Int, /** many more constructor args hence using a mock **/) {
    fun fn() = a + b
}

val mock = spyk<Entity>()
every { mock.a } returns { 1 }
every { mock.b } returns { 2 }

println(mock.a) // returns 1
println(mock.fn()) // throws NullPointerException