Spring Testing

Published: 26 March 2024
on channel: JavaAnatomy
124
3

Why testing?

Ensuring that an application work as you want it to work.
Testing should not be neglected as some developers do
It should be part of the development life cycle

We don’t write tests to increase test coverage, but to ensure the application works as expected.

Spring Boot Testing is built on top of Spring Testing
Spring 6 uses Junit 5
Junit 5 is default in Spring Boot 3

Before Junit 5, was JUnit 4
Junit 4 was a monolith application, one fat jar with everything. No separation of concern but Junit 5 is broken into modules, to have separation of concerns.

Junit 5 Modules
JUnit Platform:
A foundation for launching testing frameworks on the JVM. The engine for running tests.
JUnit Jupiter:
The new library for writing JUnit 5 tests. Think of it as an API. It brings a new programming model and extension model that includes new assertions, new annotations, support for Java 8 Lambda Expressions, etc. It’s called Jupiter because Jupiter is the fifth planet of the solar system, and it also happens to be Junit 5.
JUnit Vintage:
A library providing engines that support execution of JUnit 3 and JUnit 4 tests. This basically allows tests for Junit 3 and 4 to run on Junit 5. Support for backward compatibility.


On this page of the site you can watch the video online Spring Testing with a duration of hours minute second in good quality, which was uploaded by the user JavaAnatomy 26 March 2024, share the link with friends and acquaintances, this video has already been watched 124 times on youtube and it was liked by 3 viewers. Enjoy your viewing!