List/Grid Tag Archives: PowerMock

Using PowerMock to Mock Constructors
In my opinion, one of the main benefits of dependency injection is that you can inject mock and/or stub objects into your code in order to improve testability, increase test coverage ...

My Testing and Code Analysis Toolbox
Last week we kicked of a “Testing Skill Group” at LINEAS, a group for exchanging knowledge about testing. One question that came up over and over again in various flavors was: What ...

Mock Static Methods with PowerMock
In a recent blog, I tried to highlight the benefits of using dependency injection and expressing the idea that one of the main benefits of this technique is that it allows you to test ...

Testing an Object’s Internal State with PowerMock
Most unit testing focuses on testing an object’s behaviour in order to prove that it works. This is achieved by writing a JUnit test that calls an object’s public methods and then ...


