aspose file tools*
The moose likes Testing and the fly likes Is Mockito like Junit? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Is Mockito like Junit?" Watch "Is Mockito like Junit?" New topic
Author

Is Mockito like Junit?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
I'd like to know if Mockito does the same thing JUnit does.


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Rogerio,

the short answer is: no.

JUnit is a framework for writing and running tests (especially unit tests).
Mockito allows to create mocks (test doubles) which can replace real collaborators of a class, thus making it possible to implement some test cases.

JUnit and Mockito are often used together. JUnit is used to create the structure of test, while Mockito allow to specify some details of tests within the framework imposed by JUnit.

Please see http://junit.org and http://mockito.org for more information.


Tomek Kaczanowski
Book author: Practical Unit Testing with TestNG and Mockito
http://practicalunittesting.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Mockito like Junit?