Тёмный

Unit and Integration Tests in Spring Boot JPA Example | Tech Primers 

Tech Primers
Подписаться 134 тыс.
Просмотров 112 тыс.
50% 1

This video covers how to write Unit tests and Integrations in Spring Boot Application which uses Spring Data JPA.
📌 Related Playlist
================
🔗Spring Boot Primer - • Spring Boot Primer
🔗Spring Cloud Primer - • Spring Cloud Primer
🔗Spring Microservices Primer - • Spring Microservices P...
🔗Spring JPA Primer - • Spring JPA Primer
🔗Java 8 Streams - • Java 8 Streams
🔗Spring Security Primer - • Spring Security Primer
🔗Containers Primer - • Containers Primer
🔗Kubernetes Primer - • Kubernetes Primer
🔗AWS Primer - • AWS Primer
💥Join TechPrimers Slack Community: bit.ly/JoinTechPrimers
💥Telegram: t.me/TechPrimers
💥TechPrimer HindSight (Blog): / techprimers
💥Website: techprimers.com
💥Slack Community: techprimers.slack.com
💥Twitter: / techprimers
💥Facebook: TechPrimers
💥GitHub: github.com/TechPrimers or techprimers.github.io/
🎬Video Editing: iMovie
🎼Background Music: Broke For Free - Day Bird
brokeforfree.bandcamp.com/tra...
The Passion HiFi - What We Came To Do
Joakim Karud
---------------------------------------------------------------
🔥 Disclaimer/Policy:
The content/views/opinions posted here are solely mine and the code samples created by me are open sourced.
You are free to use the code samples in Github after forking and you can modify it for your own use.
All the videos posted here are copyrighted. You cannot re-distribute videos on this channel in other channels or platforms.
#Testing #SpringBoot #TechPrimers

Хобби

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

 

27 сен 2017

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 89   
@sangkim6338
@sangkim6338 5 лет назад
Thanks for the good video. There is one part that I don't quite seem to get - when do you put data into the h2 DB you configured?
@junysanteliz3796
@junysanteliz3796 4 года назад
Thank YOU for this! Excellent content. Very well taught! You just earned yourself a subscriber my man
@samarthurs8000
@samarthurs8000 5 лет назад
Thanks a lot, brother. Your videos are very informative.
@andrzejokon1517
@andrzejokon1517 6 лет назад
Great tutorial. Thank you!
@fairozahmed6888
@fairozahmed6888 6 лет назад
Very helpful. Thank you so much :)
@ScoobyDoo-ct9nd
@ScoobyDoo-ct9nd 4 года назад
your tutorials are good ..keep doing thanks
@isidme
@isidme 6 лет назад
Hey Thanks... How can we write Integration test when JWT security is enabled
@maryonmayor
@maryonmayor 6 лет назад
how do u do when u need to test a post via a form? and having an element that is an array.
@gurugovindgarg3771
@gurugovindgarg3771 3 года назад
👍, can you suggest how to test interface projection jpa bz we can’t set value directly to interface field
@stephaneislistening6103
@stephaneislistening6103 6 лет назад
What if we don't want to use the TestPropertySource annotation ? Is there any alternative way ?
@richardlanglois5183
@richardlanglois5183 6 лет назад
Very informative!
@bandapalliharish155
@bandapalliharish155 6 лет назад
Nice video...... also can you please post a video related to testing of spring boot security which uses daoAunthenticationprovider
@amitsinha4159
@amitsinha4159 4 года назад
Hi Sir, Could you please make a video for following use case Spring boot application with Mongo db integration but when we perform search operation then via elastic search we should retrieve record for performance reasons. I'm little confused here how to deal with this. Thanks in Advance
@abinashdhal9103
@abinashdhal9103 4 года назад
Hi , I have been given a task to implement and the task as follows . I need to integrate Spring cloud contract test to the existing project and the auto generated tests have to be validated against data in the in memory database(h2). i have integrated the contract testing to the existing project . can you give quick suggestion to implement the rest of it and if you could make a video which i know might take long time. Thanks in advance.
@KiranInEurope
@KiranInEurope 6 лет назад
can you create same unit and integration testing Spring Boot Integration DSL using microservices
@bookswiper
@bookswiper Год назад
Great insight besides learning about unit and integration test
@venkatch2584
@venkatch2584 4 года назад
Hi bro, your videos are useful, learn a lot. do you any videos for READY API test cases??
@rajum2195
@rajum2195 Год назад
thanks for a good video,your explanation is so nice,can you make a video for integration testing for a quarkus project
@yveromeev
@yveromeev 6 лет назад
thank you very much!
@haricharanreddy1633
@haricharanreddy1633 3 года назад
Hey at 4:56 what if am mocking a method which returns map Collections. emptyList() is giving error
@mo9204
@mo9204 4 года назад
Tell us when you use Jpa over CrudRepository ?
@NikitaKoselev
@NikitaKoselev 4 года назад
Good stuff. Still useful.
@vishalkadam8722
@vishalkadam8722 2 года назад
Very helpful.. Thanks for informative video.
@TechPrimers
@TechPrimers 2 года назад
Glad it was helpful!
@asifimam8174
@asifimam8174 3 года назад
kindly write some JPA unit test cases for Transactional Propagation Level and ISOLATION Levels and Level1 and Level 2 Cache Coverage
@palashkhatri7820
@palashkhatri7820 6 лет назад
Nice video got the concept
@TechPrimers
@TechPrimers 6 лет назад
thanks Palash
@amarreddy09
@amarreddy09 4 года назад
Hi .. can you please do session on spring batch+jpa+h2 testing ... Thanks
@AhmadIsyfalanaAmin
@AhmadIsyfalanaAmin 5 лет назад
Great tutorial. Would you like to add subtitles to this video?
@kirankumarkavali3897
@kirankumarkavali3897 2 года назад
Hi, Can you please make a video on how to test spring batch application using spring boot and Junit
@shakib_04
@shakib_04 2 года назад
are you sure webmvctest annotation is only for unit test not for integration test?
@Turnpost2552
@Turnpost2552 4 года назад
Really likes the song in the background.
@virtexamit
@virtexamit 6 лет назад
Nice video, can you make a video covering unit/integration test for shopping cart or something a bit complex application where in we have multiple flows hence multiple UT n integration test classes.
@TechPrimers
@TechPrimers 6 лет назад
sure. wil try amit
@virtexamit
@virtexamit 5 лет назад
Thanks a lot can you also trying a demo with sample test data. For e.g. metadata is prerequisite before running integration tests.
@stepantzov
@stepantzov 6 лет назад
Hi, thanks for sharing this! but why you do not have @ContextConfiguration?
@TechPrimers
@TechPrimers 6 лет назад
yeah it was an older notation
@mohammedsufi4649
@mohammedsufi4649 5 лет назад
Thank you for this video also please explain how mockMvc.perform() method worked in unit testing without @AutoConfigureMockMvc annotation, why should we use that in Integration testing alone even though we are autowiring the object?...
@vedikaashtekar4356
@vedikaashtekar4356 2 года назад
I think WebMvcTest includes both both the @AutoConfigureWebMvc and the @AutoConfigureMockMvc. Correct me if I am wrong.
@javatips5979
@javatips5979 2 года назад
@@vedikaashtekar4356 yes that is right
@BM-pz4mt
@BM-pz4mt Год назад
Hi sir, please can you explain Spring Batch unit and Integration testing in detailed.
@TheMikewonder1
@TheMikewonder1 6 лет назад
Hi, please can you make a video on how to test a web application using spring boot and Junit.
@TechPrimers
@TechPrimers 6 лет назад
Hi Daniel, you can find it here - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8S8o46avgAw.html
@puneetnamdeo
@puneetnamdeo 6 лет назад
please provide spring security with mockito.
@Jay-br2ud
@Jay-br2ud 3 года назад
Great
@prasadchaudhari2063
@prasadchaudhari2063 5 лет назад
how we can up spring boot context once and use same context for all junits?
@TechPrimers
@TechPrimers 5 лет назад
You can create an abstract implementation and use that in all the tests
@sanjaykantheti4002
@sanjaykantheti4002 5 лет назад
If time permits could you make a video on powerMockito as well.
@TechPrimers
@TechPrimers 5 лет назад
Sure will do
@sanjaykantheti4002
@sanjaykantheti4002 5 лет назад
@@TechPrimers Thanks Ajay!! Your channel is very informative and been following from past 1 year. keep going :)
@manggalawiryawan3242
@manggalawiryawan3242 6 лет назад
Can i make contextLoads more than one?or i make other method same like contextLoads?
@TechPrimers
@TechPrimers 6 лет назад
no you cannot do it load more than once in the same test
@DigvijayBhakuni-1990
@DigvijayBhakuni-1990 6 лет назад
do video on spring data pipelining using spring XD and Data Flow
@TechPrimers
@TechPrimers 6 лет назад
sure vijay
@valentineezugu7211
@valentineezugu7211 6 лет назад
@RequestMapping("/bookInfo" ) public String bookInfo(@RequestParam("id") Long id, Model model) { Book book = bookService.findOne(id); model.addAttribute("book", book); return "bookInfo"; } can some one test this controller just learning how to test? thanks
@karthikeyanthiruvoosivanai3181
Getting below error when execute unit testing test case Failed tests: SpringbootRestMockitoIntegrationtestApplicationTests.contextLoads:40 Wanted but not invoked: com.tsk.springboot.mockito.resource.UserRepository#0 bean.findAll();
@TechPrimers
@TechPrimers 6 лет назад
Looks like findAll()is not getting mocked
@princegovind
@princegovind Год назад
Bro , How to reduce Test execution time in build time of springBoot ..?
@TechPrimers
@TechPrimers Год назад
One option is you can make tests run in parallel
@RonaLz4
@RonaLz4 5 лет назад
But, is it really an integration test? I mean, okay. We test from the endpoint all the way to the repository, but with an h2. My point is, that sometimes doing "integration" tests with an H2 database, are in someway integration, but you are testing with a non-productive database. Anyway, that was just a thought :D Great video!
@skaffen
@skaffen Год назад
An integration test is testing two elements of code. Yes it is. It doesn't have to be end to end
@vedikaashtekar4356
@vedikaashtekar4356 2 года назад
Video is really good and helpful but the background music is really very disturbing. Without music it can be really good learning!
@machhindraneupane9207
@machhindraneupane9207 6 лет назад
Sir make a video on resttemplet with form authentication spring boot
@TechPrimers
@TechPrimers 6 лет назад
sure will do soon
@farhaankazi7134
@farhaankazi7134 4 года назад
great
@supunkavinda8660
@supunkavinda8660 6 лет назад
hi sir, can you do spring boot batch tutorial.
@TechPrimers
@TechPrimers 6 лет назад
sure supun
@dileepalla6769
@dileepalla6769 6 лет назад
can u post an vedio on how maven works?
@TechPrimers
@TechPrimers 6 лет назад
I have done that today. checkout the latest video
@dileepalla6769
@dileepalla6769 6 лет назад
i see that vedio thx
@dileepalla6769
@dileepalla6769 6 лет назад
can u post an example on google cloud how to host our application in google cloud with step by step
@jhonnyjamifernandez447
@jhonnyjamifernandez447 5 лет назад
please enable automatic translation, Your videos are great but I'm not very good in English
@rameshc6074
@rameshc6074 10 месяцев назад
Where is the assertion for integration test
@ganeshpasupuleti5485
@ganeshpasupuleti5485 4 года назад
can we unit test a spring jpa repository??
@TechPrimers
@TechPrimers 4 года назад
Yes you can. But you end up mocking the DB part
@SandeepPandey-ku4mg
@SandeepPandey-ku4mg 6 лет назад
good tutorial....please follow proper TDD approach to write the test first, than come to implementation, i.e. Fail-Pass-Refactor cycle
@d2k2
@d2k2 7 месяцев назад
so.. right?
@shihm4013
@shihm4013 6 лет назад
had to mute because of the buzzing/ringing sound
@andrii_popov
@andrii_popov 4 года назад
@WebMvcTest is the most useless test type in the whole Spring Framework, it tests no logic, I cannot image you forget to invoke service method in your controller)
@BharCode09
@BharCode09 4 года назад
Infact many mocking tests are useless and highly time consuming to write when called this, do that, blah blah! I slways do integration testing after unit testing.
@DudeMcSky
@DudeMcSky 3 года назад
These are integration tests.
@skaffen
@skaffen Год назад
As mentioned in title.
@DudeMcSky
@DudeMcSky Год назад
@@skaffen well technically the title says "Unit and Integration tests" ...there are no unit tests here.
@mrchow3177
@mrchow3177 4 года назад
If you use inteligay this wont work right of the bat..
@mertyertugrul
@mertyertugrul 4 года назад
I like your tutorials, very helpful. But I really wish that you could pronunciate better, it is really hard to understand your accent.
@farhaankazi7134
@farhaankazi7134 4 года назад
This is Indian English accent. Most of us speak in this way. Neutralizing English is bit difficult and take time. It is required.
@faN4t1k
@faN4t1k 6 лет назад
your music is annoying
Далее
This or That 🛍️
00:52
Просмотров 4,8 млн
skibidi toilet 76 (full episode)
08:11
Просмотров 10 млн
When To Unit, E2E, And Integration Test
14:58
Просмотров 91 тыс.
Integration test using spring boot
24:29
Просмотров 11 тыс.
телега - hahalivars
0:12
Просмотров 11 млн
Кто такая баба Нина?
0:49
Просмотров 2,2 млн