Unable to mockk Android ServiceInfo?

45 views Asked by At

I am trying below to mockk Android API - ServiceInfo class.

val resolveInfo = mockk<ResolveInfo>()
 val mockServiceInfo = spyk(ServiceInfo())
 every { resolveInfo.serviceInfo }.returns(mockServiceInfo)

This is giving me an exception on the last line: io.mockk.MockKException: Missing mocked calls inside every { ... } block: make sure the object inside the block is a mock

0

There are 0 answers