No video

Tests Coverage with Jacoco, Unit and Integration Tests | Spring Boot Backend #9.4

  Рет қаралды 7,805

The Dev World - by Sergio Lema

The Dev World - by Sergio Lema

Күн бұрын

In this video I show how to obtain the tests coverage with Jacoco, for both the unit and the integration tests. I show the configuration of the Surefire and Failsafe plugins to run the unit and integration tests separatly. And finally I show how to use the Surefire and Failsafe plugins to feed Jacoco.
This is the fourth part of the ninth video of a playlist where I show how to create a Spring Boot Backend, how to create a website: • Spring Boot
Content of the video:
* how to configure the Surefire and Failsafe plugins;
* how to configure Jacoco;
* how to feed Jacoco with Surefire and Failsafe;
* how to see the Jacoco results from a browser;
* how to obtain the coverage percentage from the terminal.
Command used in the video (you must replace > and < by their symbols, because KZfaq doesn't allow to print these symbols in the description): cat target/site/jacoco-ut/index.html |sed 's@\(.*\)Total</td><td class="bar">\(.*\)</td><td class="ctr2">\(.*\)</td><td class="bar">\(.*\)@\3@g'
Repository: github.com/ser...
My NEW eBook: sergiolema.dev...
Blog: bit.ly/47ornJL
LinkedIn: bit.ly/41Nn61q
Facebook: bit.ly/47rc9nh
Boost your APIs with API Monitor: bit.ly/4d7C0ny
Trainings: sergiolema.dev...
Icons:
* Check Mark by kareemov1000 from the Noun Project
* Cross by kareemov1000 from the Noun Project
* report by Vectors Market from the Noun Project
* config by Storm Icons from the Noun Project
* Plug by Hare Krishna from the Noun Project
* spy by Arafat Uddin from the Noun Project

Пікірлер: 22
@dinobulja
@dinobulja 2 ай бұрын
Thank you. Great video/explanation. But, it would be nice you added to this video also how to display code coverage in GitLab per unit and integration test and how to add visualization in gitlab. And also, how to call the pipeline jobs separately now that you have added the surefire and failsafe plugin.
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 2 ай бұрын
That's a lot of topics for a single video 😅 You can watch another video I have about Gitlab if you want more details about how to configure jobs: kzfaq.info/get/bejne/mL1nibCWuK6qfps.html
@adribg
@adribg 3 жыл бұрын
Thank you very much for your clear explanation!
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 3 жыл бұрын
Glad it helped you!
@replikvltyoutube3727
@replikvltyoutube3727 9 ай бұрын
Thanks for the video that better explain configuration in pom
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 9 ай бұрын
You're welcome!
@2kiranns
@2kiranns 2 жыл бұрын
This video was helpful for me to setup Jacoco. Thanks.
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 2 жыл бұрын
Glad it helped you
@2kiranns
@2kiranns 2 жыл бұрын
The final part of maven command execution should have been included in the video. Adding them for completeness: mvn clean test --> Runs unit tests and creates code coverage report for UT alone mvn clean verify -P integration-test --> Runs IT and creates code coverage report for both UT & IT mvn clean verify -P all-tests --> Runs all the tests & creates all the report
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 2 жыл бұрын
Maybe you're right, but my goal was to show how easy is to obtain the unit and integration tests coverage. If the viewers want more information it's easy to find it in the Jacoco documentation.
@jeyakumarisundaram8811
@jeyakumarisundaram8811 Жыл бұрын
Thank you very much!!
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema Жыл бұрын
You're welcome!
@kushmishra9197
@kushmishra9197 3 ай бұрын
I have two different repo - one containing integration tests and another the repo which needs to be tested. Can I know the test coverage of these integration tests ?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 3 ай бұрын
I know no system that can merge the two coverages.
@rangalakshmir.t8541
@rangalakshmir.t8541 Жыл бұрын
could you make a video for code coverage for maven multi module project?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema Жыл бұрын
I will put it in my TODO list 👍
@DinMamma002
@DinMamma002 Жыл бұрын
Does this also work if you make http requests to your web server instead of using MockMvc?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema Жыл бұрын
I'm not sure about your question? You mean make requests manually?
@808sprng
@808sprng 11 ай бұрын
I wish it worked for me 🥶
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 11 ай бұрын
I'm sorry, what's the problem? Maybe the version of the libraries I use in the video are not yet up to date
Integration Tests in Spring Boot with MockMvc, DBUnit and H2 | Spring Boot Backend #9.2
11:08
Testcontainers - From Zero to Hero. By @MarcoCodes
1:01:29
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 74 М.
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 10 МЛН
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 96 МЛН
Prank vs Prank #shorts
00:28
Mr DegrEE
Рет қаралды 10 МЛН
wow so cute 🥰
00:20
dednahype
Рет қаралды 31 МЛН
Build Your Webpage With Spring Boot and Thymeleaf in Less Than 20 Minutes
18:50
The Dev World - by Sergio Lema
Рет қаралды 7 М.
Spring Security & JWT | Spring Boot Backend #3
18:33
The Dev World - by Sergio Lema
Рет қаралды 9 М.
Jacoco | Java Code Coverage | Jococo with Maven
30:55
SDET- QA
Рет қаралды 38 М.
Spring boot + sonarqube + jacoco
10:16
Sergey Labuzov
Рет қаралды 1 М.
How to use Spring Cloud Config Server with Git and Vault | Microservices 4
10:50
The Dev World - by Sergio Lema
Рет қаралды 11 М.
Cookie based authentication with Spring Security | Spring Boot Backend #3.2
22:58
The Dev World - by Sergio Lema
Рет қаралды 21 М.
Mastering Testcontainers by Oleg Šelajev
52:24
Devoxx
Рет қаралды 9 М.
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 10 МЛН