-
-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
Hey @lupuuss thanks for your continued work!
Problem
Kotlin: 2.3.0
AGP: 9.0.0
Mokkery: 3.2.0
When following the guide to mock a class, any enum fields on that class will not be mocked. When trying to access the field, a nullpointer is thrown.
Repro Steps
Take the given enum
enum class BrokenEnum {
BROKEN
}
Take the given class (with your defined allopen annotation)
@Mockable
class BrokenMock(
val someField: String,
val enum: BrokenEnum
)
mock it, try to assert
val testMock = mock<BrokenMock>()
assertTrue {
testMock.enum == BrokenEnum.BROKEN
}
I'm unsure if this is an issue with the allopen plugin or Mokkery. Removing the @Mockable (or similar) annotation and manually adding open to the class definition works without issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels