Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

learning resources for mockito [closed]

i am required to use mockito to create unit testing framework for existing code. I am unable to find a good place to get started with learning Mockito. Could you please point me to a good learning resource for mockito? (online resource or otherwise)

like image 513
Aadith Ramia Avatar asked Sep 10 '09 11:09

Aadith Ramia


People also ask

What is the difference between JUnit and Mockito?

JUnit and Mockito can be primarily classified as "Testing Frameworks" tools. JUnit and Mockito are both open source tools. It seems that Mockito with 9.02K GitHub stars and 1.62K forks on GitHub has more adoption than JUnit with 7.53K GitHub stars and 2.8K GitHub forks.

Is Mockito only for Java?

The mocking technique is not only used in Java but also used in any object-oriented programming language. There are many frameworks available in Java for mocking, but Mockito is the most popular framework among them. To mock objects, you need to understand the three key concepts of mocking, i.e., stub, fake, and mock.

What is the difference between mock and Mockito?

Mockito has been around since the early days of Android development and eventually became the de-facto mocking library for writing unit tests. Mockito and Mockk are written in Java and Kotlin, respectively, and since Kotlin and Java are interoperable, they can exist within the same project.


2 Answers

In the "Help me to start" thread on the mockito discussion group on Google, Szczepan Faber, the project owner of mockito, suggests:

  • the Documentation which includes some examples
  • Brett L. Schuchert's tutorial

I'd take a look at the posts in the mockito category of Szczepan's blog too.

like image 128
Pascal Thivent Avatar answered Sep 22 '22 02:09

Pascal Thivent


For a overview about mock and mockito you can refer Mockito-a-great-mock-framework-for-Java-development

like image 36
Anver Sadhat Avatar answered Sep 20 '22 02:09

Anver Sadhat