Long Tran
10/09/2023, 9:27 AMspyk
which provided by Mockk
The code as below:
@JvmInline
value class MyValueClass(Val value: String = “”) : Serializable
class A(
Val valueClass: MyValueClass = MyValueClass()
)
// In unit test file
@Test
fun test() {
Val mockClass = spyk<A>()
…
}
And this error happened
io.mockk.MockKException: Can't instantiate proxy via default constructor for class A
Appreciate with your help 🙏Pablichjenkov
10/09/2023, 10:24 AMLong Tran
10/09/2023, 3:07 PMPablichjenkov
10/09/2023, 3:12 PMLong Tran
10/09/2023, 3:38 PMMockK
document, they have the same meaning in the case of the default constructor thoPablichjenkov
10/09/2023, 4:25 PM