You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension functions are treated as static functions when you're testing them with Mockito or any other framework. This means that Mockito will fail you when you try to verify method invocations on the wrapper.
Unfortunately, PowerMockito doesn't help either. From the digging I did, the way you do it with PowerMockito is:
mockStatic(CustomWrapper::class.java)
// The following code is the problem. Since extension functions aren't static, this // actually won't compile.
`when`(CustomWrapper.getCustomAttribute()).thenReturn()
The text was updated successfully, but these errors were encountered:
Extension functions are treated as static functions when you're testing them with Mockito or any other framework. This means that Mockito will fail you when you try to verify method invocations on the wrapper.
Unfortunately, PowerMockito doesn't help either. From the digging I did, the way you do it with PowerMockito is:
The text was updated successfully, but these errors were encountered: