Spring Boot Testing Mini-Series Part #3: Database Tests

  Рет қаралды 10,936

Code With Arho

Code With Arho

Күн бұрын

Пікірлер: 45
@rajkrishna1933
@rajkrishna1933 Жыл бұрын
your videos on testing related code is amazing.frankly there are mo much actual hands on spring test on youtube.please make more such videos
@codewitharho
@codewitharho Жыл бұрын
Much appreciated!
@jesper7605
@jesper7605 Жыл бұрын
Great content! You cover several useful things I've never heard someone talk about before.
@codewitharho
@codewitharho Жыл бұрын
Thank you!
@robinmathur5807
@robinmathur5807 3 жыл бұрын
Very clear explanation. After spending many hours finally found a good playlist on this topic. Great job man.
@codewitharho
@codewitharho 3 жыл бұрын
Thank you, always glad when someone finds it useful!
@cloudsquall88
@cloudsquall88 3 жыл бұрын
As always, amazing explanations! Thank you so much!
@codewitharho
@codewitharho 3 жыл бұрын
Thanks, really means a lot that people find it useful!
@gallanonim4914
@gallanonim4914 Жыл бұрын
Arho - you provide wonderful content, great job 💪 Is there any chance to see new videos from you?
@codewitharho
@codewitharho Жыл бұрын
Thank you! I should eventually get back to it - currently in the middle of moving places and renovations.
@MrVitalirapalis
@MrVitalirapalis 2 жыл бұрын
Good music, man :) the content as well
@codewitharho
@codewitharho 2 жыл бұрын
Thank you!
@FadiQua
@FadiQua 2 жыл бұрын
Nice! Thank you for the tutorial
@codewitharho
@codewitharho 2 жыл бұрын
I’m glad you found it useful.
@pryflack3646
@pryflack3646 3 жыл бұрын
Best presentation of Spring I've seen so far, thanks and please keep them coming! How would you stay with an SQL test script, and deal with deep hierarchies requiring foreign keys all the way up? I'd love to hear about the object mother pattern. PS: it's pronounced "skeema" not shama ;)
@codewitharho
@codewitharho 3 жыл бұрын
Thanks! And also thank you for the pronunciation tip :D I try to avoid deep hierarchies but I understand that sometimes you need more complex data. I would look at Database Rider for more complex data setup. There's a little bit of information about the test data builder and object mother in the DRY vs DAMP video I made: kzbin.info/www/bejne/mXWXhZunndN0ppI (although I'm considering a separate video about those patterns).
@pryflack3646
@pryflack3646 3 жыл бұрын
Thanks I’ll have a look at database rider. I’m still a little unclear about the object mother pattern so I’ll be on the lookout then ;) I very much enjoy your channel, keep up the great work!
@fotistsavalos2193
@fotistsavalos2193 3 жыл бұрын
Nice series and great job!! Thank you!!
@codewitharho
@codewitharho 3 жыл бұрын
Thank you and you're welcome!
@AndrulisTravel
@AndrulisTravel 2 жыл бұрын
Your videos are very good. Just my suggestion. Create a simple Rest API model/repository/service/controller with the basic post, put, get methods and a little bit of logic in the service layer (check if email exists, etc.). And then write tests. I understand that this will require time, but a full detailed video will have much more views from beginners.
@codewitharho
@codewitharho 2 жыл бұрын
In my testing videos I’m currently assuming some basic knowledge about Spring. But I’ll keep in mind that there could be demand for some beginner Spring tutorials as well. Thanks for the suggestion!
@AndrulisTravel
@AndrulisTravel 2 жыл бұрын
@@codewitharho Thanks for the replay. The idea was not to show how to create a Spring Boot app, but how to test it. You could use the already prepared app with 4 standard endpoints and some logic in the service layer. One entity and a repository. And show how to write all tests for this simple app :) It would cover all the basics in one video.
@codewitharho
@codewitharho 2 жыл бұрын
Ah, I see. Actually, I have an overview video planned for the series. The reason that it is a series of smaller videos is that it takes a lot of time to make them and I wanted to see if they attract any interest. Will definitely consider a longer tutorial in the future! Thanks again for the feedback!
@hypnoticlizard9693
@hypnoticlizard9693 2 жыл бұрын
@@codewitharho I think these videos are great but I dont think they have mainstream appeal as they are on a niche subject. You should set up some kind of donation link so you can get supported by the few people who benefit from these videos. As that will allow you to make great content even if the viewership isnt very high. I appreciate the efforts to make these videos.
@rajkrishna1933
@rajkrishna1933 Жыл бұрын
protobuf with rest api java is a topic which has limited resources in youtube.if you can,please add videos on this topic too..
@codewitharho
@codewitharho Жыл бұрын
That’s quite a specific topic and unfortunately don’t have experience on.
@hendisantika
@hendisantika 2 жыл бұрын
How do we mix testcontainers, mysql & flyway? Do You have article about that? Thanks
@codewitharho
@codewitharho 2 жыл бұрын
I don’t have an article about MySQL specifically but you should be able to follow the article that uses Postgres and just replace the Postgres image with a MySQL image.
@MrNoxior
@MrNoxior Жыл бұрын
Why do you use an EntityManager in the tests? Isn't it better to use an injected repository?
@codewitharho
@codewitharho Жыл бұрын
TestEntityManager helps you to test the full cycle of storing and retrieving the entity, e.g. flush the persistence context cache and then read the entity from the database. Otherwise the test could just end up reading from in-memory cache.
@tko1176
@tko1176 4 ай бұрын
When you remove the flush part, when does the flush occurs to make fail the test again? 14:36
@codewitharho
@codewitharho 4 ай бұрын
It fails because it doesn't flush. Without specifically flushing it's up to the framework to do the flushing and we have no control of when that happens. The constraint check only happens on the database level after the flush.
@tko1176
@tko1176 4 ай бұрын
@@codewitharho I understand. Thank you.
@kalyankasyapgarimella1047
@kalyankasyapgarimella1047 2 жыл бұрын
Test Containers using private registry url images??? Can we have a video on this
@codewitharho
@codewitharho 2 жыл бұрын
Thanks for the suggestion! It’s a very specific question and making these videos takes quite a lot of time, so I’d suggest asking in stackoverflow.com
@ductamnguyen8257
@ductamnguyen8257 3 жыл бұрын
Hi Arho, hope you're doing well. Do you know about Database Migration? and do you how to Unit Testing for Database Migration? Thanks in advance.
@codewitharho
@codewitharho 3 жыл бұрын
I’m not sure what you mean. I went briefly through the migrations in the video. What kind of information are you after?
@ductamnguyen8257
@ductamnguyen8257 3 жыл бұрын
@@codewitharho Thanks for your reply, yes you have gone briefly through database Migration.
@sohrabsheykhmohammadi1909
@sohrabsheykhmohammadi1909 2 жыл бұрын
thank you so much
@codewitharho
@codewitharho 2 жыл бұрын
You’re welcome!
@rajkrishna1933
@rajkrishna1933 Жыл бұрын
your videos on testing related code is amazing.frankly there are mo much actual hands on spring test on youtube.please make more such videos
@codewitharho
@codewitharho Жыл бұрын
Thanks, I appreciate that a lot! I have been struggling to find a good work life balance and am currently trying to arrange things so that I can focus more on this channel.
Spring Boot Testing Mini-Series Part #4: Serialization Tests
7:23
Code With Arho
Рет қаралды 3,2 М.
Spring Boot Testing Mini-Series Part #1: Unit Testing
9:25
Code With Arho
Рет қаралды 19 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН
БЕЛКА СЬЕЛА КОТЕНКА?#cat
00:13
Лайки Like
Рет қаралды 1,8 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 66 МЛН
Никита Летов - Используем @Transactional like a Pro
1:16:31
JPoint, Joker и JUG ru
Рет қаралды 55 М.
Transactional Gotchas in Spring Boot Tests
25:54
Tales from the jar side
Рет қаралды 2,9 М.
Spring Boot Testcontainers - Integration Testing made easy!
33:31
15 futuristic databases you’ve never heard of
8:42
Fireship
Рет қаралды 677 М.
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 151 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН