Difference that mockito makes with junit

3,468 views
Skip to first unread message

bharat

unread,
Mar 9, 2011, 5:48:30 AM3/9/11
to mockito
Can anyone tell me, what exactly the difference between junit and
mockito in simple terms.

Thomas Sundberg

unread,
Mar 9, 2011, 6:11:52 AM3/9/11
to moc...@googlegroups.com, bharat
Hi!

JUnit is a framework for writing tests that can assert the
functionality of a method. JUnit can test anything as long as it is
possible to call a method from a test class.

Mockito is a framework that can be used in a JUnit test to
mock/fake/mimic a class that the method under test need but is
difficult to create or has a side effekt that unwanted during a test.

My attempt to a short and clear description. Hope this give you a
start on exploring JUnit and exploring Mockito.

/Thomas

On Wed, Mar 9, 2011 at 11:48, bharat <bhara...@gmail.com> wrote:
> Can anyone tell me, what exactly the difference between junit and
> mockito in simple terms.
>

> --
> You received this message because you are subscribed to the Google Groups "mockito" group.
> To post to this group, send email to moc...@googlegroups.com.
> To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
>
>

--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

szczepiq

unread,
Mar 9, 2011, 5:48:09 PM3/9/11
to moc...@googlegroups.com
Exactly.

Simple put: jUnit is a test runner + assertion methods to validate state. Mockito is a tool to create subs or to validate interactions between objects.

Cheers!
Szczepan
Reply all
Reply to author
Forward
0 new messages