|
|
|
|
|
by mrkeen
579 days ago
|
|
> So now we cannot easily mock final classes in tests > And mocking tools have to resort to bytecode manipulation to mock the final classes Well which is it? Presumably you use said mocking tool anyway, so it's not your effort that's being expended. "Final all the things" really doesn't go far enough. There is little point substituting a mutable hashmap for a "final" mutable hashmap, when the actual solution is for the standard library to ship proper immutable collection classes. In any case, I prefer to avoid mockito anyway, so it's a non-issue for me. Just do plain ol' dependency injection by passing in dependencies into constructors. |
|
And I’ve never forgiven him for it