I just delivered EasyMock CE 2.5 about five minutes ago. Helped from suggestions of many users, I think I've managed to build a clean and friendly API to create partial mocks. It's based on the builder pattern.

PartialMock mock = createMockBuilder(PartialMock.class)
    .addMethod("foo")
    .withConstructor(1, 2, 3)
    .createMock();

As you can see, pretty straightforward and no reflection required anymore.

The complete list of changes is here:

  • Incorrectly wrapped exception returned when EasyMock methods receive a parameter that is not a mock
  • Stub exception causes NPE (2407137)
  • Move to Subversion
  • Build entirely with Maven
  • Objenesis not embedded anymore
  • Add OSGi header to manifest (2774873)
  • New IMockBuilder interface to easily perform partial mocking (2822905, 2788098, 2783949)
  • Class mocks are now serializable (1963458)

I hope you will enjoy this new and long awaited version and I'm looking forward for any feedback.

The roadmap is now to deliver EasyMock 2.5.1 which will be under Apache 2.0 license. Then will come EasyMock 2.5.2 which will include EasyMockSupport for class extension.

After that EasyMock CE will be synchronized with EasyMock. Work on EasyMock 3 will then start.