Тёмный

Software Testing with Spring boot and Mockito Framework 

Bouali Ali
Подписаться 57 тыс.
Просмотров 31 тыс.
50% 1

Buy me a coffee: ko-fi.com/boua... In this video, Alibou takes you on a journey to understand the significance of unit tests in software development. Discover the real-world scenarios where a single line of code can make or break your application. We'll unveil the secret weapon - Unit Testing - and explore how it empowers developers to build reliable, resilient software.
🚨 Why You Need a Safety Net for Your Code
Learn how unit tests act as a safety net around your code, catching potential issues before they reach production. Gain the confidence to make changes and improvements without the fear of causing chaos in your application. We'll guide you through practical examples, showcasing the real impact of robust testing practices.
🎟 Join this channel to get access to perks: / @boualiali
Recommended Courses:
🎬 Spring Boot security & JWT token: • Spring boot 3.0 - Secu...
🎬 Spring security - Roles and permissions: • Spring boot 3 & Spring...
🎬 Spring Boot - Microservices architecture: • Microservices tutorial...
🎬 DevOps - Github Actions CI/CD: • GitHub Actions CI/CD p...
🎬 Spring Security - KeyCloak integration: • Spring boot 3 Keycloak...
🎬 DevOps - Docker for Beginners: • Docker tutorial for be...
🎬 DevOps - AWS EC2 deployment: • 🚀 Deploy Spring boot a...
🎬 Angular - Full course from scratch: • Angular Tutorial For B...
🎬 Websocket - Chat application one to one: • WebSocket Tutorial wit...
🎬 Spring Security - Two Factors Authentication 2FA (TFA): • Two Factor Authenticat...
🎬 Spring Boot - Swagger UI & OpenApi Decomentation : • Spring boot 3 - OpenAp...
🎬 Spring Boot - Reactive programming & WebFlux: • Reactive Programming w...
🎬 Spring Data JPA & Hibernate: • Spring Data JPA - The ...
🎬 Apache Kafka tutorial: • Apache Kafka Tutorial ...
🎬 Spring batch tutorial: • Spring batch
CONNECT WITH ME:
👨‍💻. Website: aliboucoding.com
👨‍🏫 Facebook: / 589612651142975
📸 Instagram: / alibou_coding
🎮 GitHub: github.com/ali...
🏘️ Discord: / discord
#SpringBoot #UnitTesting #Mockito #SoftwareDevelopment #Java #Coding

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 77   
@poorpanda9033
@poorpanda9033 9 месяцев назад
Perfect Upload. I was just learning about unit & integration testing & you've uploaded at the right time. Thanks a lot !
@BoualiAli
@BoualiAli 5 месяцев назад
Glad it was helpful!
@hieunguyen0801
@hieunguyen0801 9 месяцев назад
Can you make a video about using Redis in Spring Boot and PostgreSQL?
@BoualiAli
@BoualiAli 5 месяцев назад
soon
@thilaks3895
@thilaks3895 28 дней назад
@@BoualiAli please make a video for integration testing with the redis and postgresql in springboot 3.
@buntykumar5928
@buntykumar5928 5 месяцев назад
please make more videos on unit testing and mockito which used more complex code like service class depends on multiple different service class and use spring security for authorization and authentication and encryption decryption for request and response object. Your video is really helpful and thanks sir for sharing your great knowledge with us.
@BoualiAli
@BoualiAli 4 месяца назад
noted
@TarunStk-bf5re
@TarunStk-bf5re 3 месяца назад
Hi Alibou, Your content is very good, much appreciated. It would've been even great if you've covered code coverage as well. Thanks
@zee8105
@zee8105 Месяц назад
Hi Bouali , do you have any videos on integration testing? it could be a payed version too, really interested if you do. thanks!
@jnayehsirine6222
@jnayehsirine6222 7 месяцев назад
Always providing high quality Content , THANK YOU !!
@BoualiAli
@BoualiAli 5 месяцев назад
Glad you think so!
@davidb.5486
@davidb.5486 3 месяца назад
Literally amazing tutorial, the only thing missing was testing the controller.
@krishnamadhav7639
@krishnamadhav7639 Месяц назад
Can you please upload the link for the code used in this tutorial. I couldn't find it in the description.
@ivansanchez1988
@ivansanchez1988 4 месяца назад
Do you have a complete course on testing, where we can get the initial code to learn along with you? I enrolled into your platform, the content is awesome, thanks for the effort.
@armaan.nagpuri
@armaan.nagpuri 14 дней назад
How to see the class diagram that you showed?
@fufufifi2349
@fufufifi2349 9 месяцев назад
بارك الله فيك و يرحم والديك ، جات الوقت المناسب
@BoualiAli
@BoualiAli 5 месяцев назад
baraka allahou fik
@marcincylkowski3004
@marcincylkowski3004 9 месяцев назад
Thank you for this video. Please continue topic of testing.
@BoualiAli
@BoualiAli 5 месяцев назад
sure
@firas_hkimi
@firas_hkimi 9 месяцев назад
After One month Sir ALi Bouali come Back 🥰
@Vinicius-xe8br
@Vinicius-xe8br 2 месяца назад
you're amazing thanks !
@aziztolearn
@aziztolearn 8 месяцев назад
Could you do a video about how to be in testing with jwt-security ? how to add jwts or fake jwts when testing and how to test login or auth methods, endpoints?
@BoualiAli
@BoualiAli 5 месяцев назад
good idea
@rohanreddy2067
@rohanreddy2067 4 месяца назад
Waiting for it
@aliksargsyan2782
@aliksargsyan2782 Месяц назад
how can i find the source code of this project ?
@diagspring144
@diagspring144 9 месяцев назад
Very nice boulai Ali thank you☺️☺️☺️🎁🙏🏾🙏🏾 for the video happy the new year
@BoualiAli
@BoualiAli 5 месяцев назад
Glad you liked it!
@odilhonislomov8954
@odilhonislomov8954 7 месяцев назад
Thanks. Great explanation as usual
@BoualiAli
@BoualiAli 5 месяцев назад
My pleasure!
@2RAJ21
@2RAJ21 Месяц назад
Thank you
@BoualiAli
@BoualiAli 14 дней назад
You're welcome
@ankitagarwal969
@ankitagarwal969 8 месяцев назад
I had the same query asked below. Want to know the spring boot version used here.
@BoualiAli
@BoualiAli 5 месяцев назад
spring 3
@k.ousmanediallo4134
@k.ousmanediallo4134 8 месяцев назад
This is a great video explaining the basic concept for ut. please can you provide the code source for all app not including for test part
@BoualiAli
@BoualiAli 5 месяцев назад
there is no app for that. just showcase services
@roueroua140
@roueroua140 8 месяцев назад
Awesome dude ❤🙏🙏🙏
@BoualiAli
@BoualiAli 5 месяцев назад
Glad you think so!
@CodingBeTounsi
@CodingBeTounsi 9 месяцев назад
saha aloulou
@BoualiAli
@BoualiAli 5 месяцев назад
you're the best
@DJCava3000
@DJCava3000 5 месяцев назад
where can I find the code for this video?
@BoualiAli
@BoualiAli 5 месяцев назад
in the description
@rijorejimathew1776
@rijorejimathew1776 2 месяца назад
@@BoualiAli cant find it in description
@pritikumari-n7o1h
@pritikumari-n7o1h 9 месяцев назад
hi Ali, can i get the source code link?
@javasystems5850
@javasystems5850 8 месяцев назад
Can you make videos on DevOps
@BoualiAli
@BoualiAli 5 месяцев назад
which part of it?
@jasper5016
@jasper5016 7 месяцев назад
Thanks a lot. Can you please share source code?
@BoualiAli
@BoualiAli 5 месяцев назад
In the description
@cdinglevel8626
@cdinglevel8626 3 месяца назад
Sir codesource please is not in the description
@Obrik
@Obrik 3 месяца назад
*Table of Contents* (By the way, a "mock" is an empty version of an object, and a "stub" is a mock with some functionality added back in.) 00:00 Testing is important, here's why 06:05 What is Spring Test? (tl;dw it's a testing library for Java). 8:49 How the example program is organized (tl;dw StudentMapper has a Student object with student info, and has a StudentResponseDto object (Dto stands for Data transfer object). StudentService has a StudentRepository object and a StudentMapper object.) 10:59 Making a test class for StudentMapper 14:58 Test Class exists, first (Hello World) test function ``` @Test public void testMethod1(){ System.out.println(“My first test method”); } ``` 16:50 The SetUp method, @BeforeEach 19:01 The TearDown method, @AfterEach 20:42 @BeforeAll (BeforeClass) method 22:30 @AfterAll (AfterClass) method 23:55 First actual test, and what the StudentMapper functions do 29:57 First test is done and runs 30:06 Causing the first test to fail 32:07 Practice Exercise - implement test for toStudentResponseDto method 32:50 Practice Exercise answer 34:44 Given, When, Then, test structure 35:39 Third test: studentDto to student if null. 38:15 Fixing the source code to handle null. Adjusting test to expect exception, and getting the exception message (assertThrows(exceptionType, () -> { code });) 42:31 Explanation of StudentService and database, test isolation with mocking (Mockito) 45:01 Creating new test class for StudentService 46:30 First and second @Mock 47:33 @InjectMocks 48:22 Opening/starting the mocks (MockitoAnnotations.openMocks(this);) 49:21 First test method for StudentService, saving a student 52:48 Why the result is null/failing. Mocking functions for test isolation’s sake. when().thenReturn() 57:31 Test with mocks (and stubs) is ready and runs 59:06 Making sure the methods were only called once, using Mockito.verify() 1:02:20 Practice Exercise - test findAllStudent() method, using mocks (and stubs) as needed 1:02:53 Practice Exercise answer (including using mockito any() method) 1:06:33 Practice Exercise - test findStudentById() method 1:06:52 Practice Exercise answer (including Optional.of()) 1:10:07 Bouali Ali is proud of you 1:10:13 Practice Exercise - test findStudentsByName() 1:10:45 Practice Exercise answer
@youbabagayogo3052
@youbabagayogo3052 8 месяцев назад
You changed my life of spring developper and i'm ready to buy on your plateforme a complete course of how to deploy spring boot project on aws (AWS Amplify, AWS S3, AWS RDS, AWS EC2). It will be a pleasure to follow such course. Thanks for everything
@BoualiAli
@BoualiAli 5 месяцев назад
now, all my content is and will be for free. No one should pay to learn You are welcome to contribute if you want to
@melissapereira6957
@melissapereira6957 6 месяцев назад
can you do more videos about testing ? perhaps testing the controller layer ? i loved the lecture, you helped me a lot. 😊
@BoualiAli
@BoualiAli 5 месяцев назад
Yes, soon
@raghusama4273
@raghusama4273 3 месяца назад
Do we have the video of development / Implementation of that Student project ?
@abdullohmaraimov2022
@abdullohmaraimov2022 День назад
Perfectly explained, thank you Mr.Perfecto
@christianjaena1803
@christianjaena1803 5 дней назад
Should you write test first before implementation or the other way round?
@kanehamath6162
@kanehamath6162 7 месяцев назад
Interessting and well understanding, big thanks
@farjallahhaythem5675
@farjallahhaythem5675 9 месяцев назад
best as always
@yosefhagos4788
@yosefhagos4788 8 месяцев назад
Great Video!!! Could you provide us with the link to the repository? How to test controller classes ? How do you test the database connection and whether data is read and saved correctly?
@MonsterBebesi-cd7ot
@MonsterBebesi-cd7ot 6 месяцев назад
githup ?? this video resoruce
@odilhonislomov8954
@odilhonislomov8954 6 месяцев назад
Can you make a video about Integration testing?
@BoualiAli
@BoualiAli 5 месяцев назад
soon
@georgepro8481
@georgepro8481 8 месяцев назад
I think that the repository level must be tested first of all. It doesn't need to test basic CRUD operations of a repository. But we have a lot of fun besides. For insance, test the fact that repository realy gives an id for a new entity. Does the audit feature (createdAt, modifiedAt) realy work? Does it throw correct exceptions? Does your SQL query correspond to your expectations? How to mock DB (embedded, docker) ...
@BoualiAli
@BoualiAli 8 месяцев назад
This is the integration tests level. I will cover it soon
@pranavmahajan4190
@pranavmahajan4190 7 месяцев назад
You are a fantastic teacher. Thanks a lot. Can you please cover integration testing of REST services ?
@BoualiAli
@BoualiAli 5 месяцев назад
Yes, soon
@malithabannahake
@malithabannahake 8 месяцев назад
can you tell me which repo, you used for the testing, can you provide the link?
@BoualiAli
@BoualiAli 5 месяцев назад
I dont have a repo for it
@maleeshasandakalum6213
@maleeshasandakalum6213 8 месяцев назад
Thank you very much. Really appreciate your for your effert ❤❤❤❤
@BoualiAli
@BoualiAli 5 месяцев назад
my pleasure
@samahmahdi5511
@samahmahdi5511 5 месяцев назад
Thanks, it is excellent illustration
@BoualiAli
@BoualiAli 5 месяцев назад
I'm glad you like it
@wasamr4703
@wasamr4703 8 месяцев назад
Thank you man, this video is really helpful
@BoualiAli
@BoualiAli 5 месяцев назад
Glad you liked it!
@khalildhamer2589
@khalildhamer2589 9 месяцев назад
Great content, keep going !!
@BoualiAli
@BoualiAli 5 месяцев назад
Glad you liked it!
Далее
The ULTIMATE Spring Boot course | 8 HOURS Course
7:34:24
Просмотров 149 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 80 тыс.
Se las dejo ahí.
00:10
Просмотров 851 тыс.
Spring Boot Testing - ** Batteries Included 🔋🔋
41:12
What is JUnit? | Why Mockito?
14:38
Просмотров 369 тыс.
Test Driven Development (TDD) in Spring
51:09
Просмотров 26 тыс.