Impressive! I'm a Tester who is working with Developers to improve their Unit Testing and code quality. I've been tasked to put together some training materials and I'm going to include this. The video hits on so many things, but makes them very clear and concise in definition and explanation. You show both the power & advantages of the tool(s) you use and for Unit Testing itself. So glad I found this.
I wish I had found this earlier !! I spent quite a lot of time figuring out different tutorials for JUnit 5 and I ended up not writing JUnits for my Repository interfaces but going through this video has made me realize the simplest of ways to test Repositories by setting up H2 in memory database. Perfectly narrated and at a good pace. Keep up the good work !!
thanks so much sir I have been working as backend engineer for 5 months I was given a task to write unit test and integration test. this give me great star. I am going ahead and enroll on your course for integration testing. thanks so much.
Oh God, your explanation is so good and simple. I was able to understand what happen behind the scene of the testing and especially in the debug part. This is my first time learning the JUnit testing, thankfully you are the first that pop up in the search engine :D. Thank you for your teaching sir, sadly I cannot afford your course in software testing, I wish I had money to afford for :). But the good thing I was able to learn in this video. Please don't stop creating a video like this, thank you 🙇♂
Love it. You're a great teacher. I'm a Java boot camp student and I really appreciate seeing how a professional dev does it vs how I'm taught. Learning so many great tricks thanks to you!
This tutorial is neat, as usual. Just a humble remark : @29:00, i think the variable expected should be named "result" (or "actual") to be coherent with what you nicely explained regarding BDD, since it's in the when part of the given-when-then methodology. Else, the assert is a little bit confusing: assertThat(expected).isTrue(); Should be: assertThat(result).isTrue(); Thanks a lot for everything you bring to the community.
Thank you! The topic of testing is often neglected when teaching programming. It makes sense to learn this very early and get into the habit of writing tests for your code. As you said, there is no way around this in professional software development.
Great Tutorial Thank you, I am learning from your course after watching other JUnit tutorial , thank you for showing a proper real world example. feeling more confident now, Looking forward to explore videos from your channel Just for others that are following here are things I had to do: - got error complaining about lambok not getting access to a class, update the version, I updated Spring boot to latest version in the pom.xml file - spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1 this is the url path that worked for me
OMG i am so glad I found you. You have such an amazing way of explaining things. You are truly a natural at this. Your voice and teaching style is so soothing, I feel like it's my close friend explaining this complicated stuff to me. You are amazing, God bless! I can't thank you enough!
FYI the contextLoads test is not pointless at all, it verifies that the application is bootstrapped correctly and there is no exception raised by the application context. If you have missing configuration properties or some (auto)wiring issues that test would have caught it.
Hello Nelson Thank you so much for your professionnalisme, infact I so much enjoyed going through this testing and mocking. I am thinking of going through it once more to grasp the essentials,frankly speaking you are excellent in the ways you make things look simpler indah
Good evening dear friend I am a Moroccan developer in java spribg boot and I love your tutorials. I have a request please if you can make a video on spring kafka and thank you in advance
Hey man, your vidieos are really amazing that I have to admit :)) If you have time, please compose socket videos. You have a good explaining so I think you can give the best anwser how the socket works. Thank you and have a good day!
Great course, thanks! Before watching the video, I got a little familiar with the theory of integration testing and this made it easier to understand the topic. Took a little effort to write a test to check for the possibility of deletion, it was great! I will watch your content in the future peace!
Thank you for you very useful videos and above all for your very very clear English language: this is a great added value for us followers not having English as mother tongue.
h2 in-memory database for tests can leak some features that you use in application db (postgres or mysql) so it's handy to use test containers, looking forward to testcontainers tutorial :)
Hi, I dont know why, but I cloned the branch you suggested. And the contextLoads test failed... :((( Dose it still works for you? ok, probably thats why: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. Still dont know how to fix
I'm not sure if I'm the only one struggling with some of your tutorials but a lot of times I can't setup the projects like you do. For the DemoApplcationTest right in the beginning of this tutorial I am getting an "Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method" error. I have only cloned your project and tried to run the test...
Hi, thank you for the tutorial. Question: Can use @Autowired to inject the student service object instead of creating it in the setUp() method? I wanted to try it, but I get a NullPointerException. Can someone please tell me what I did wrong?
Test run on minute 37:20 failed (for me). I changed "spring.jpa.properties.hibernate.dialect" from "org.hibernate.dialect.PostgreSQLDialect" to "org.hibernate.dialect.H2Dialect" and then it works
I really enjoyed this video. This is my first time playing with tests. I heard that software engineers write tests before actually coding their projects. I wonder if the same is true for Spring Boot developers.
At 54:00 the test is not efficient enough. I hope it was done for the sake of simplifying the usage of Mockito otherwise poor test. Instead of verifying that the correct repository method was called, you should mock the method response to return something and then assert that the service method returns the same thing that you mocked. For example if you call the repository method in service method but also return empty list of Students then the test would also pass.
Impressive! I'm a Tester who is working with Developers to improve their Unit Testing and code quality. I've been tasked to put together some training materials and I'm going to include this. The video hits on so many things, but makes them very clear and concise in definition and explanation. You show both the power & advantages of the tool(s) you use and for Unit Testing itself. So glad I found this.
I wish I had found this earlier !! I spent quite a lot of time figuring out different tutorials for JUnit 5 and I ended up not writing JUnits for my Repository interfaces but going through this video has made me realize the simplest of ways to test Repositories by setting up H2 in memory database. Perfectly narrated and at a good pace. Keep up the good work !!
cant you use rollbacks etc?
I am a college student studying in Korea. All of your lectures are very, very good.
Perhaps one of the few videos that actually show an integration test rather than the usual theoretical approach.
Masha Allah keep it up.
Wa alaikum salam wr. wb. I never doing any test before. And now in my new company, I have to doing test. Very helpful. Thank you for sharing.
thanks so much sir
I have been working as backend engineer for 5 months
I was given a task to write unit test and integration test.
this give me great star.
I am going ahead and enroll on your course for integration testing.
thanks so much.
I was just looking for this topic and this appears on my recomendations, how convinient
It's the third time it happened to me this week
Yes please need a kafka tutorial as well, because now a days kafka is in demand. thanks in advance and for every tutorial, they are really helpful.
Oh God, your explanation is so good and simple. I was able to understand what happen behind the scene of the testing and especially in the debug part. This is my first time learning the JUnit testing, thankfully you are the first that pop up in the search engine :D.
Thank you for your teaching sir, sadly I cannot afford your course in software testing, I wish I had money to afford for :). But the good thing I was able to learn in this video. Please don't stop creating a video like this, thank you 🙇♂
Love it. You're a great teacher. I'm a Java boot camp student and I really appreciate seeing how a professional dev does it vs how I'm taught. Learning so many great tricks thanks to you!
This tutorial is neat, as usual.
Just a humble remark : @29:00, i think the variable expected should be named "result" (or "actual") to be coherent with what you nicely explained regarding BDD, since it's in the when part of the given-when-then methodology.
Else, the assert is a little bit confusing: assertThat(expected).isTrue();
Should be: assertThat(result).isTrue();
Thanks a lot for everything you bring to the community.
Thank you! The topic of testing is often neglected when teaching programming. It makes sense to learn this very early and get into the habit of writing tests for your code. As you said, there is no way around this in professional software development.
This is amazing, the most professional level video I've ever seen on TH-cam. Liked and Subscribed.
Thank you, I'm new in Java ecosystem so your courses are very valuable.
جزاك الله خيرا
This was the second video course I wacthed from this channel.
Thank you so much for the video quality and the explanations.
Really good!
Excellent tutorial!
Your technical and educational skills 👨🎓 match your kindness and goodness.
Keep it up! 💪
Saludos desde Uruguay mi amigo 💙🤍
A Symfony 4 development environment with Docker and Docker-compose
th-cam.com/video/2t_R-F2Z7xs/w-d-xo.html
I had a lot of questions while watching this video, but you always answered on my questions a few minutes later, you are awesome dude.
Great Tutorial Thank you, I am learning from your course after watching other JUnit tutorial , thank you for showing a proper real world example. feeling more confident now, Looking forward to explore videos from your channel
Just for others that are following here are things I had to do:
- got error complaining about lambok not getting access to a class, update the version, I updated Spring boot to latest version in the pom.xml file
- spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
this is the url path that worked for me
For me, one of the best teachers all around.. greetings from Spain Amigo!!
OMG i am so glad I found you. You have such an amazing way of explaining things. You are truly a natural at this. Your voice and teaching style is so soothing, I feel like it's my close friend explaining this complicated stuff to me. You are amazing, God bless! I can't thank you enough!
These video finally made me understand what the hell what all this testing thing all about, loved it
What happened to the integration tests at 1:14? Where's anything about basic @Entity testing? Are there other videos where these things are covered?
Best unit & integration tests tutorial so far, thanks mate
Can you do a kafka tutorial? There's not many good ones out there
Yeah I've found spring kafka very confusing!
Especially spring batch
yes please! agree
@@MintyKanesh Yeah, you ever read "the castle" by kafka? Makes no sense!
kindly do one for spring kafka
FYI the contextLoads test is not pointless at all, it verifies that the application is bootstrapped correctly and there is no exception raised by the application context. If you have missing configuration properties or some (auto)wiring issues that test would have caught it.
You have excellent teaching skills, thanks for your effort.
You are the best teacher for programming by far.
why i does not found this last month? Its amazing! Hey, you have a talant to explain things by simple language!
Love your courses!
Greetings from Argentina
Es un capo el Amigoscode
Hello Nelson
Thank you so much for your professionnalisme, infact I so much enjoyed going through this testing and mocking. I am thinking of going through it once more to grasp the essentials,frankly speaking you are excellent in the ways you make things look simpler
indah
This is basically an entire university subject practice in one video. Awesome job
Very good and great that you motivate programmers to write tests :) There is so much stuff you _will_ miss if you don't write a Test.
Thank you so much. I watched the entire tutorial all the way to the end
When testing the if student email exists, you could use a getter for the email defined in the student model class. Great video!
Good evening dear friend I am a Moroccan developer in java spribg boot and I love your tutorials. I have a request please if you can make a video on spring kafka and thank you in advance
Thanks a lot , among all the massive trainings out there, I have been studying yours since the past months, well and clearly explained and updated!
you can also create an ArgumentCaptor with the @Captor annotation
This is gold. Finally someone that explains testing to me in an understandable way. Thank you so much.
That was a great example at the end, thank you!
Awesome! You've covered everything that I was looking for! Keep this up!
Great tutorial overall. One suggestion. Plz consider zooming out a bit. Thanks!
Hey man, your vidieos are really amazing that I have to admit :)) If you have time, please compose socket videos. You have a good explaining so I think you can give the best anwser how the socket works. Thank you and have a good day!
Great course, thanks!
Before watching the video, I got a little familiar with the theory of integration testing and this made it easier to understand the topic. Took a little effort to write a test to check for the possibility of deletion, it was great!
I will watch your content in the future
peace!
А почему future peace? Это же кусок не?
Thanks for a good tutorial, this was exactly what I needed. Keep it up! :)
wa alaikum as salam!! Thank you for this huge tutorial. I'm still new to backend. Gotta learn more
Again right to the point, easily understandable and great content as always 👏🏽
You really know how to get the message across! Thank you very much for this video!
Salam Alikum, what to say, amazing are your courses, barak Obama fik; sorry Barak Allah fik :).
Test cases are failing to connect to postgresql . What are the prerequisites for this project to run?
Thank you very much, Amigo, this topic has always been too vague and unclear for me.
I'm a simple man. I see Nelson thumbsup, I click on video
Thank you for you very useful videos and above all for your very very clear English language: this is a great added value for us followers not having English as mother tongue.
Recently saw your channel...Loving your videos...Keep posting....Anything related to data science will be helpful...
Great video for understanding unit testing and mocking
h2 in-memory database for tests can leak some features that you use in application db (postgres or mysql) so it's handy to use test containers, looking forward to testcontainers tutorial :)
Hey, may I ask you what you mean by leak? Can you elaborate please?
@@GSBroker i meant - miss some features that are applicable for some databases only
Hey bro. Thank you so much. I love your courses, it is useful and clear.
ты молодец! желаю миллион подписчиков твоему каналу )
Thanks😍😍 Superb Tutorial🥰🥰
@amigoscode how were you able to pass student repository instance? Line number 14, @ 45:29
This is a great video! Very well explained!
You are amazing, keep moving, and thanks so much 🌷
Great tutorial Nelson, really love your content
Hi, I dont know why, but I cloned the branch you suggested. And the contextLoads test failed... :(((
Dose it still works for you?
ok, probably thats why:
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Still dont know how to fix
change application.properties file to your own values
Great looking forward to it
I'm not sure if I'm the only one struggling with some of your tutorials but a lot of times I can't setup the projects like you do. For the DemoApplcationTest right in the beginning of this tutorial I am getting an "Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method" error. I have only cloned your project and tried to run the test...
Thank you Nelson! You're the best teacher
و عليكم السلام و رحمة الله و بركاته، بارك الله فيك أخونا.
Thank you so much brother.
32:20 while I am creating application properties it did not show directories. How can I create application properties in Spring Tool Suite
Thank you! You are a good teacher!
this looks really good, I will buy the course next month
Thank you! Great tutorial! 💛
Thanks for this!! You’ve earned a new subscriber!
at 29:28 , when i run, in the repository line, in mine, it is showing nullPointer in underTest. I didn't understand why. Do you have any guidance?
ThanX Bro. You're a great teacher. Literally saved me here
I was wondering if you can create a crash course on Web Development, amazing content as always :D
Thanks for this Tutorial, I have an interview tomorrow for Junit Test
Hi, thank you for the tutorial.
Question: Can use @Autowired to inject the student service object instead of creating it in the setUp() method?
I wanted to try it, but I get a NullPointerException.
Can someone please tell me what I did wrong?
Such an amazing tutorial
Wa 3alikum el salam brother happy to find a Muslim brother in this field that alone puts a lot of inspiration
Also wonderful explenation ! Helped a lot
Great video! I have learned a lot. Thank you.
Hi! This video is very good. Concepts are well explained, thank you :)
why pom xml cloned from the repo is different than the one in the video?
i gave up at 37:10..
It also helped me to understand the software engineering topics..
Wealykum aselam, thank you bro . It is helpful
Test run on minute 37:20 failed (for me). I changed "spring.jpa.properties.hibernate.dialect" from "org.hibernate.dialect.PostgreSQLDialect" to "org.hibernate.dialect.H2Dialect" and then it works
Thank you i was having the same issue and this resolved it
I really enjoyed this video. This is my first time playing with tests. I heard that software engineers write tests before actually coding their projects. I wonder if the same is true for Spring Boot developers.
Finally! Thanks bro.
Do have experience with message brokers like kafka or rabbitmq? I would appreciate sharing video about these technologies too
Thanks for the video! I'm really like the way you teach.
Nice video brother. Keep up this great work.Just want to mention one thing I think you misspelled “in sha Allah”. Thanks
Thanks a lot you are always supportive
At 54:00 the test is not efficient enough. I hope it was done for the sake of simplifying the usage of Mockito otherwise poor test. Instead of verifying that the correct repository method was called, you should mock the method response to return something and then assert that the service method returns the same thing that you mocked. For example if you call the repository method in service method but also return empty list of Students then the test would also pass.
Hey, in which program do you make your UML diagrams?
Jazakallah Khair brother , Happy Ramadan
A man with zero haters
Thanks, barakaAllahu fik
Great content brother !!
Thanks a lot, that was really nice, perfect and well explained
Thank you very much. Very clear explanation
Could someone tell me which hotkey is used at 27:46 to extract the string value and create a variable?