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
I think when Mockito tries to inspect the constructor to match it to declared mocks, it finds more parameters than we put in the code when writing the constructor (e.g., a 3 parameter constructor actually has 5 parameters when it gets inspected).
The text was updated successfully, but these errors were encountered:
Could mockito-kotlin provide a custom MemberAccessor that wraps ReflectionMemberAccessor to check if one of the parameters is the DefaultConstructorMarker? If it isn't, it can delegate to the ReflectionMemberAccessor and same same.
However if it finds the DefaultConstructorMarker parameter, it can figure out what the bit mask should be, add it along with a null value for the marker to the list of arguments and then instantiate the class.
I've asked the question here and there's a code example: https://stackoverflow.com/questions/68933185/injectmocks-doesnt-work-with-kotlin-constructor-arguments-with-default-values
I think when Mockito tries to inspect the constructor to match it to declared mocks, it finds more parameters than we put in the code when writing the constructor (e.g., a 3 parameter constructor actually has 5 parameters when it gets inspected).
The text was updated successfully, but these errors were encountered: