Expand Authors Top

If you have a few years of experience in the Java ecosystem and you’d like to share that with the community, have a look at our Contribution Guidelines.

Expanded Audience – Frontegg – Security (partner)
announcement - icon User management is very complex, when implemented properly. No surprise here.

Not having to roll all of that out manually, but instead integrating a mature, fully-fledged solution - yeah, that makes a lot of sense.
That's basically what Frontegg is - User Management for your application. It's focused on making your app scalable, secure and enjoyable for your users.
From signup to authentication, it supports simple scenarios all the way to complex and custom application logic.

Have a look:

>> Elegant User Management, Tailor-made for B2B SaaS

Java Top

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

> CHECK OUT THE COURSE

1. Overview

Mockito is a popular mocking framework for Java. But, before we start, we have some different artifacts to choose from.

In this quick tutorial, we'll explore the difference between mockito-core and mockito-all. Afterward, we'll be able to choose the right one.

2. mockito-core

The mockito-core artifact is Mockito's main artifact. Specifically, it contains both the API and the implementation of the library.

We can obtain the artifact by adding the dependency to our pom.xml:

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-core</artifactId>
    <version>3.3.3</version>
</dependency>

At this point, we can already start using Mockito.

3. mockito-all

Of course, mockito-core has some dependencies like hamcrest and objenesis that Maven downloads separately, but mockito-all is an out-dated dependency that bundles Mockito as well as its required dependencies.

To verify this, let's look inside the mockito-all.jar to see the packages it contains:

mockito-all.jar
|-- org
|   |-- hamcrest
|   |-- mockito
|   |-- objenesis

The latest GA version of mockito-all is a 1.x version released in 2014. Newer versions of Mockito don't release mockito-all anymore.

The maintainers released this dependency as a simplification. Developers were supposed to use this if they don't have a build tool with dependency management.

4. Conclusion

As we explored above, mockito-core is the main artifact of Mockito. Newer versions don't release mockito-all anymore. Henceforth, we should only use mockito-core.

Java bottom

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

>> CHECK OUT THE COURSE
Junit footer banner
Comments are closed on this article!