Mock final class with Mockito 2
Weird that your solution seems to work. According to their documentation on Github it says. Mocking of final classes and methods is an incubating, opt-in feature. It uses a combination of Java agent instrumentation and subclassing in order to enable mockability of these types. As this works differently to our current mechanism and this one … Read more