Using another JUnit Runner with PowerMock
PowerMock 1.6.0 was released a couple of days ago and the main new feature expect for better support for Mockito 1.10.x is the ability to combine the PowerMockRunner with another…
PowerMock 1.6.0 was released a couple of days ago and the main new feature expect for better support for Mockito 1.10.x is the ability to combine the PowerMockRunner with another…
Mocking is a well-known and estabilished concept in our field of work as developers. There are a lot of frameworks for creating and setting up expectations on mock objects in…
A while ago I blogged about how to use the PowerMock Rule to bootstrap PowerMock without using a JUnit runner. A problem that you'll likely run into sooner or later…
Currently PowerMock builds on top of EasyMock and Mockito to provide mocking of e.g. static methods and final classes using a familiar API. What most people don't know is that…
I quite often get the question if PowerMock can be used together with Spring integration testing or other frameworks that require a JUnit runner to bootstrap. The answer up until…
Background In PowerMock we're using a custom classloader to byte-code manipulate classes that are normally not mockable to make them mockable. But when running a test case there may be…
After having it on our todo list for at least a year we've finally managed to integrate PowerMock with TestNG 5.11 as of PowerMock version 1.3.5. This is a big…
As you may already know PowerMock can be used to easily mock static methods which is normally not possible with standard mock frameworks such as EasyMock, JMock or Mockito. All…
In JayView 17 we presented a short introduction to PowerMock, a framework that allows you to create automated tests for almost any code in isolation from its environment. In this…
After a discussion about PowerMock with @olabini on Twitter I felt I had to write a post on testability. The truth "Autonomous, re-runnable, code-based tests are objectivity good" has created…
Introduction Unit testing is a very powerful tool that should be included in every developer's toolbox. Unfortunately, this has not always been the case, especially not among MIDlet developers. One…
The challenge PowerMock is a mocking framework that claims to have almost supernatural powers. According to its documentation it is able to mock both static and private methods, final classes,…
We're proud to announce that PowerMock 1.1 was released a couple of days ago and it has many new interesting features. Framework independence First of all the internal structure of…
We have released 1.0 of PowerMock just in time for the Øredev conference! PowerMock is an open source mock framework based on EasyMock that allow you to mock static methods, private methods and even constructors. Our intent is mainly to allow unit testing of legacy code and people really seemed to appreciate this idea at the conference.
Previously a colleague of mine described an idea for mocking static methods. Earlier this year we started an open source project to implement these ideas in a very simple to…