TestProject Forum
Powered by leading experts in the test automation community

Java mocking framework for testing legacy components?

Whats the best framework for mocking in Java?

The last project i worked on was in .Net so I have been writing my unit tests with NUnit and using FakeItEasy framework.

In my current project I’m looking to do the same but in Java. Are there any good frameworks like FakeItEasy for Java ?

Mockito is a nice and easy to learn framework that would suit your needs. https://github.com/mockito/mockito

You could also try EasyMock but the learning curve takes longer than diving in with mockito.