-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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()Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request