# Mockito Reviews
**Vendor:** Mockito  
**Category:** [Java Web Frameworks](https://www.g2.com/categories/java-web-frameworks)  
**Average Rating:** 4.6/5.0  
**Total Reviews:** 22
## About Mockito
Mocking framework for unit tests in Java.




## Mockito Reviews
  ### 1. Mockito - One of the best mocking framework for unit testing

**Rating:** 4.5/5.0 stars

**Reviewed by:** Verified User in Information Technology and Services | Enterprise (> 1000 emp.)

**Reviewed Date:** November 10, 2020

**What do you like best about Mockito?**

I like the most that it has huge stack overflow community to help you out. we can verify any interactions and stub our method calls. Using mockito in your existing project is the most easy job.

**What do you dislike about Mockito?**

I am not able to think of any dislike though i would say the more you explore the framework  the more you will love working with mockito.

**Recommendations to others considering Mockito:**

I would recommend mockito framework to everyone who is involved in writing unit test cases as it would make job easy with respect to stubbing your objects.

**What problems is Mockito solving and how is that benefiting you?**

Mockito helped me in writing some simple and quick test cases. Most of the time we have external dependencies like databases or file interactions that we want to eliminate while unit testing so mockito is helpful at these times.

  ### 2. Mocking framework used to write clean, simple and effective test cases.

**Rating:** 4.5/5.0 stars

**Reviewed by:** Prathamesh S. | Software Engineer, Mid-Market (51-1000 emp.)

**Reviewed Date:** September 21, 2020

**What do you like best about Mockito?**

One of the best frameworks out there to create Mock objects to enable testing.
Decouples the testing logic from the implementation, making it easier to write clean test cases.

Ability to easily mock almost any object as per the requirements. No need to write mock objects on your own. Easiest solution out of the box to support such requirements.

One of the biggest challenges with any testing/mocking framework is the support for refactoring. In Mockito renaming interface method names or reordering parameters will not break the test code as mocks are created at runtime.

Those who work with Junits are well familiar that returning values is a very difficult or tedious task. Mockito however supports return values out of the box. Another blessing is the support for exceptions and ability to easily handle them. Also supports check on order of method calls.

As we get more and more advanced in terms of Java, use of annotations is a great benefit to get rid of the boiler plate code. Mockito supports creating mocks using annotation.

**What do you dislike about Mockito?**

Though not a steep one but there is a learning curve for sure. You need some kind of background in writing test cases to understand the usage and effectiveness of Mockito.

Mockito doesn't support mocking of local variables, static methods and private methods. Managing mock objects within abstract test cases has been very difficult for me.

**Recommendations to others considering Mockito:**

When compared to EasyMock, Mockito is hands down the better choice. The ease of use, complimented with the how user friendly the new API names are makes it the default implementation for writing test cases.

**What problems is Mockito solving and how is that benefiting you?**

Writing readable and clean test cases. Unit testing has become mandatory in the age of Agile, and automating most of this testing using frameworks like Mockito is the need of the hour. Also  by increasing the overall application test coverage which directly contributes to increased stability of the application.

  ### 3. Ease of writing test cases and the ability to get test coverage to almost 100%

**Rating:** 5.0/5.0 stars

**Reviewed by:** Subhodeep D. | Application Developer, Enterprise (> 1000 emp.)

**Reviewed Date:** December 21, 2020

**What do you like best about Mockito?**

Ability of coverage of REST web services. This really helps if there is a complicated scenario in which multiple negative cases might fall into action. It simply makes the process much easier to debug.

**What do you dislike about Mockito?**

There is nothing I dislike about Mockito in particular. The use of the annotations driven architecture in Spring Boot makes the process of writing test cases much more easier.

**Recommendations to others considering Mockito:**

Just go through the basic documentation and you should be good to go.

**What problems is Mockito solving and how is that benefiting you?**

100% code coverage testing. Positive and negative test case scenarios can be covered. Being able to use Mockito makes it secure to an extent that the possible variations of any web service SOAP/Rest can be leveraged. The ability to mock the service layers or the view layers helps to easily validate complicated WSDL files too.

  ### 4. The Mockito, an amazing library for for Unit Testing.

**Rating:** 5.0/5.0 stars

**Reviewed by:** shrawan a. | Software Engineer, Mid-Market (51-1000 emp.)

**Reviewed Date:** December 16, 2020

**What do you like best about Mockito?**

- Highly Active Community
- Continuous improvement
- Annotation support
- Available for Multiple Platforms
- Clean and Convenient methods

**What do you dislike about Mockito?**

The only deal-breaker for me would be:
-  Proxy-based (No bytecode manipulation) 
( But it does seem like its integration with PowerMock still makes it a top choice )

**Recommendations to others considering Mockito:**

- An easy and clean Unit testing framework, to test the functionality of a class in isolation in a controlled way.
- Actively maintained, community support and available for multiple platforms

**What problems is Mockito solving and how is that benefiting you?**

Working with a large codebase, with constant changes and new features. Mockito supports unit testing with clean and convenient methods to maintain and perform rapid roll out with outstanding code quality.

  ### 5. Perfect tool for testing framework

**Rating:** 4.5/5.0 stars

**Reviewed by:** Olga K. | Full Stack Software Engineer, Mid-Market (51-1000 emp.)

**Reviewed Date:** February 18, 2021

**What do you like best about Mockito?**

It's possible to test a lot fo conditions and it's easy to read. Just need to know what's happening inside. Once you learn it, it's clear.

**What do you dislike about Mockito?**

When you want to debug inside, you actually need google help here. Not everything is obvious.

**What problems is Mockito solving and how is that benefiting you?**

Creating problems and different scenarios is what's needed in any TDD. We are heavily invested into testing all the bits and pieces of our code, and Mockito is being used all the time.

  ### 6. Best testing framework, I really enjoy using this framework

**Rating:** 4.5/5.0 stars

**Reviewed by:** Verified User in Computer Software | Mid-Market (51-1000 emp.)

**Reviewed Date:** November 26, 2020

**What do you like best about Mockito?**

1. Very easy to use.
2. Very less configuration is needed.
3. Provide both annotation as well as class based configuration.
4. I can fully mock an object as well as partially mock an object that is very helpful when I just need to test some methods of a class which I created and leave the other methods which I do not case about.
5. Method name are fluent based so Its very descriptive for others when they read the test cases.

**What do you dislike about Mockito?**

Not having support of mocking static methods.
Even when static methods are utility methods and that should not require mocking but sometime we get a usecase where it is very hard to actually call static method and we need to mock.

**Recommendations to others considering Mockito:**

Very good framework for unit testing.
Easy to use. Descriptive and fast.

**What problems is Mockito solving and how is that benefiting you?**

Very easy to use, And  unit testing becomes easier. As well as fluent methods make test cases very informative.

  ### 7. Simple, intuitive and a must have for unit testing in spring environment

**Rating:** 5.0/5.0 stars

**Reviewed by:** Pranav C. | Enterprise (> 1000 emp.)

**Reviewed Date:** December 14, 2020

**What do you like best about Mockito?**

It's easy to learn, easy to interpret, and minimal code needs to be written to setup a mock in mockito.

**What do you dislike about Mockito?**

Don't see any downsides, it's been perfect tool for the requirements I've faced in my experience.

**What problems is Mockito solving and how is that benefiting you?**

Writing test cases can be painful, one needs some tool to mock a functionality when writing a test case for a certain method, be it an external call or a complicated method which doesn't needs your attention right now, just mock it and write a test case for the method in hand.

  ### 8. Mokito lets you write beautiful tests with a clean & simple API

**Rating:** 5.0/5.0 stars

**Reviewed by:** Dhruva A. | Software Engineer, Small-Business (50 or fewer emp.)

**Reviewed Date:** December 17, 2020

**What do you like best about Mockito?**

Test code can be decoupled from the implementation.
Creation of the mocks through annotations.
Its ability to integrate easily with the existing projects makes it faster and easy to use.

**What do you dislike about Mockito?**

So far it has been so good for me. But I am sure any downsides will be greatly outnumbered by the features it has.

**What problems is Mockito solving and how is that benefiting you?**

I am using it to write unit test cases and mocking the functionality. It's very easy to learn and use.

  ### 9. Unit Testing made easy by Mockito

**Rating:** 5.0/5.0 stars

**Reviewed by:** Apurva R. | Associate Consultant, Enterprise (> 1000 emp.)

**Reviewed Date:** January 20, 2021

**What do you like best about Mockito?**

Mockito offers best platform for easy usage. I can easily mock an object if I need to test some methods of a class and not the whole. It ease to use made my coding life easy.

**What do you dislike about Mockito?**

It doesn't support mocking static and private methods.

**What problems is Mockito solving and how is that benefiting you?**

It helped me write quick test cases .

  ### 10. Mockito is very useful, I love writing tests with mockito

**Rating:** 5.0/5.0 stars

**Reviewed by:** Sahit B. | Software engineer, Small-Business (50 or fewer emp.)

**Reviewed Date:** December 19, 2020

**What do you like best about Mockito?**

I can write very readable and maintained code with mockito

**What do you dislike about Mockito?**

Since I use mockito I didn't notice something I don't like

**What problems is Mockito solving and how is that benefiting you?**

Definitely unit testing

  ### 11. I have been using Mockito for last  8+ years in JEE development.  Mockito is in all Junit test.

**Rating:** 5.0/5.0 stars

**Reviewed by:** Verified User in Financial Services | Mid-Market (51-1000 emp.)

**Reviewed Date:** January 06, 2021

**What do you like best about Mockito?**

Mocking underlaying database or service,

**What do you dislike about Mockito?**

mockMvc.perform(xxx)
.andExpect(status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.[0]")
JsonPth matcher syntax is very hard that I dont like.

**Recommendations to others considering Mockito:**

Sure. I recommend 100% to any other developer.

**What problems is Mockito solving and how is that benefiting you?**

Mainly Junit test. For unit test I can isolate everything by Mockito.

  ### 12. A MUST HAVE TOOL FOR DEVELOPERS TO DELIVER QUALITY CODE

**Rating:** 5.0/5.0 stars

**Reviewed by:** Verified User in Hospital & Health Care | Enterprise (> 1000 emp.)

**Reviewed Date:** November 30, 2020

**What do you like best about Mockito?**

Assertions and other mocking features really help in a development environment where you can not execute black-box tests while it's in the development phase. It helps deliver quality code.

**What do you dislike about Mockito?**

Version conflicts. Some of the mockito versions have compatibility issues and are not robust.

**Recommendations to others considering Mockito:**

Highly Recommended for Agile Environment.

**What problems is Mockito solving and how is that benefiting you?**

Unit Tests / Unit Test suit

  ### 13. Awesome to use and have ease of implementation. Helps you to write bug free code.

**Rating:** 4.0/5.0 stars

**Reviewed by:** Abhimanu R. | Data Engineer, Small-Business (50 or fewer emp.)

**Reviewed Date:** November 27, 2020

**What do you like best about Mockito?**

Ease of implementation. And writing test case to write/deploy bug free code. Ease to debug.

**What do you dislike about Mockito?**

There may are certain things like mocking static methods.

**Recommendations to others considering Mockito:**

Mockito is easy to use and implement and for testing it's awesome

**What problems is Mockito solving and how is that benefiting you?**

Writing test case to deploy bug free code.

  ### 14. Mockito is easy to use and integrate into framewoks and covers all of the flows

**Rating:** 5.0/5.0 stars

**Reviewed by:** Abdul Ahad A. | Software Engineer, Small-Business (50 or fewer emp.)

**Reviewed Date:** December 01, 2020

**What do you like best about Mockito?**

Ability to mock auth to execute test cases as a loged in user

**What do you dislike about Mockito?**

The documentation can be improved more for better understanding

**Recommendations to others considering Mockito:**

Do read documentation througly to avoid hassels

**What problems is Mockito solving and how is that benefiting you?**

I am using it to automate test cases

  ### 15. Great tool for java mocking for unit test

**Rating:** 5.0/5.0 stars

**Reviewed by:** Akshay J. | Software Engineer, Enterprise (> 1000 emp.)

**Reviewed Date:** November 06, 2020

**What do you like best about Mockito?**

Power to mock scenarios and data for your code to write unit test.

**What do you dislike about Mockito?**

There is a small learning curve for a new developer. But once learned very easy to use and develop.

**What problems is Mockito solving and how is that benefiting you?**

Testing scenarios for unit testing the functionality.
Mocking database calls, mocking static methods and classes are easy.

  ### 16. Mockito test coverage

**Rating:** 4.5/5.0 stars

**Reviewed by:** Verified User in Education Management | Mid-Market (51-1000 emp.)

**Reviewed Date:** November 30, 2020

**What do you like best about Mockito?**

After using mockito we improved junit coverage percentage in projects.

**What do you dislike about Mockito?**

By using mockito writing junit for Static methods.

**What problems is Mockito solving and how is that benefiting you?**

By using mockito fixtures we reuse REST API response. It's reduce code rewrite.

  ### 17. The good tool for mocking or drinking it ;)

**Rating:** 4.5/5.0 stars

**Reviewed by:** Simon C. | developer, Small-Business (50 or fewer emp.)

**Reviewed Date:** July 22, 2020

**What do you like best about Mockito?**

I like it the best as it's easy to use and the documentation is easy to ready and easy to understand.

**What do you dislike about Mockito?**

I don't have anything on top of my head right now what I would dislike.

**Recommendations to others considering Mockito:**

Just use it as it's really easy to use and you will enjoy it :).
It will help you with writing jUnit and component tests and will make your live much much easier.

**What problems is Mockito solving and how is that benefiting you?**

The biggest benefits is while writing tests and mocking everything what is possible :)

  ### 18. It's a very useful tool

**Rating:** 4.0/5.0 stars

**Reviewed by:** Verified User in Information Technology and Services | Small-Business (50 or fewer emp.)

**Reviewed Date:** December 22, 2020

**What do you like best about Mockito?**

No need to write mock objects
Supports annotations

**What do you dislike about Mockito?**

Additional learning of mockito technology

**Recommendations to others considering Mockito:**

You should try to use it and see if it is a good match for you

**What problems is Mockito solving and how is that benefiting you?**

It helps me to test the functionalities of a class in isolation (no database connection needed)

  ### 19. Mockito is a great Unit testing tool and our team uses it for unit testing and it works very good.

**Rating:** 3.5/5.0 stars

**Reviewed by:** Verified User in Entertainment | Small-Business (50 or fewer emp.)

**Reviewed Date:** November 28, 2020

**What do you like best about Mockito?**

Refactoring Safe part is the best, it allows to rewrite the interfaces without hampering the running code.

**What do you dislike about Mockito?**

noting much as of now. would surely come back later and write something here

**What problems is Mockito solving and how is that benefiting you?**

We are performing unit testing on our application using it

  ### 20. It is good mocking framework

**Rating:** 4.5/5.0 stars

**Reviewed by:** Verified User in E-Learning | Mid-Market (51-1000 emp.)

**Reviewed Date:** November 24, 2020

**What do you like best about Mockito?**

It is easy to use and it also provides some annotations for reducing boilerplate code.

**What do you dislike about Mockito?**

mockito's inability to mock static methods.

**What problems is Mockito solving and how is that benefiting you?**

Writing java unit test cases.

  ### 21. Rapid Testing Mockito

**Rating:** 5.0/5.0 stars

**Reviewed by:** James W. | Java Developer, Financial Services, Small-Business (50 or fewer emp.)

**Reviewed Date:** December 03, 2019

**What do you like best about Mockito?**

Mockito lets me quickly put together comprehensive tests without spending a lot of time writing initialization and data generation code - you just mock what you tests actually need.

**What do you dislike about Mockito?**

It can be a challenge dealing with static code and the matchers could be more flexible, more like more recent additions to generics.

**Recommendations to others considering Mockito:**

The best thing to to do is try it out. It's really easy to get going with and once you see how easy it can make things you won't go back.

**What problems is Mockito solving and how is that benefiting you?**

Maintaining a high level of test coverage. Scenarios where there are many edge cases to cover, are a lot easier to deal with using Mockito.

  ### 22. Great open source FW to work with

**Rating:** 3.5/5.0 stars

**Reviewed by:** Amrut K. | Amrut Katwa, Enterprise (> 1000 emp.)

**Reviewed Date:** March 28, 2019

**What do you like best about Mockito?**

Best thing is it doesn't need any connection with DB, it itself creates mock objects and sends to services to check the reliability of code written.


**What do you dislike about Mockito?**

Sometimes we do not know what to give the values for certain test cases. It requires good knowledge about writing conditions.

**Recommendations to others considering Mockito:**

Very good to test the code written by one, when you know the possible outcomes of that code.

**What problems is Mockito solving and how is that benefiting you?**

To test the code coverage and branch coverage, to check for loopholes if any.


## Mockito Discussions
  - [What is the use of Mockito in JUnit?](https://www.g2.com/discussions/what-is-the-use-of-mockito-in-junit)
  - [What is difference between JUnit and Mockito?](https://www.g2.com/discussions/what-is-difference-between-junit-and-mockito)
  - [What is Mockito tool for?](https://www.g2.com/discussions/what-is-mockito-tool-for)
  - [What are benefits of Mockito?](https://www.g2.com/discussions/what-are-benefits-of-mockito)

- [View Mockito pricing details and edition comparison](https://www.g2.com/products/mockito/reviews?section=pricing&secure%5Bexpires_at%5D=2026-05-13+10%3A23%3A52+-0500&secure%5Bsession_id%5D=a03ff450-770f-4d49-b130-74a1254144a3&secure%5Btoken%5D=4e0a41306d6d432570e90900466c10d072439d1cde9bdb6d66c502284e1b18e4&format=llm_user)


## Top Mockito Alternatives
  - [spring.io](https://www.g2.com/products/spring-io/reviews) - 4.5/5.0 (290 reviews)
  - [JHipster](https://www.g2.com/products/jhipster/reviews) - 4.4/5.0 (83 reviews)
  - [Grails](https://www.g2.com/products/grails/reviews) - 3.6/5.0 (23 reviews)

