General dependencies

Dependencies required for running tests should be in the project configuration. Additional libraries may also be necessary depending on the project under test. For version information, see Specs & Reqs.

Dependency
Description

Test Framework

Surefire Plugin org.apache.maven.plugins: maven-surefire-plugin

When using Maven and junit-jupiter-engine.

JUnit Launcher org.junit.platform: junit-platform-launcher)

When using junit-jupiter-engine, unless using Maven, Spring, or Spring Boot.

Spring Boot Test

org.springframework: spring-boot-test

When using Spring Boot ( org.springframework:spring-boot).

Spring Test org.springframework: spring-test

When using Spring ( org.springframework:spring-core) unless using Spring Boot.

Mockitoorg.mockito: mockito-core

For mocking using Mockito.

Other dependencies listed below may be needed, if they are transitive dependencies of your project. If one of these dependencies is required but missing, tests will be generated for some classes but not others. A message will appear in the console output indicating a missing dependency. For version information, see Specs & Reqs.

Dependency

Java Servlet API

javax.servlet:javax.servlet-api or jakarta.servlet:jakarta.servlet-api

JSR107 API and SPI

javax.cache:cache-api

Spring Boot Starter Test

org.springframework.boot:spring-boot-starter-test

Spring Security Config

org.springframework.security:spring-security-config

Spring Web MVC

org.springframework:spring-webmvc

Last updated