5:00 Integration test 10:40 Controller Unit testing 13:45 Controller creation 14:46 Service unit testing 19:05 Exception handler creation 25:29 Repository unit testing 51:28 Integration testing
Something that often messes up importing dependencies in IntelliJ is this: in preferences, under Build, Execution, Deployment / Build Tools / Maven / Importing, un-check the checkbox that says "Keep source and test folders on reimport". I don't know who would ever want this checked. It basically makes the IDE ignore when you try to reimport dependencies.
Don’t get a purpose of testing repositories instead of larger units like application services or even modules. It is close to the “test-per-class” antipattern. I think we should focus more on testing behavior than implementation :)
In the beginning, it was good because I have already seen Phil webb Spring Boot testing session. You guys are also good but network connection or something it get spoiled there. I loved it the beginnning abd now xou can see in teg i ma alos gettngi bda. :P
Thanks for doing presentation on this. It was good at start, kind of lost interest once network problem started happening and we started into caching. Personally, I also felt we were going too fast with the presentation giving little time to understand what is written.
Thanks, I’m gonna check it, cause I had the same issue and I have to close the project and open the pom as a maven project so the dependencies load again in IntelliJ workspace .idea
@DataJpaTest is itself is annotated with @AutoConfigureCache with @PropertyMapping("spring.cache.type") CacheType cacheProvider() default CacheType.NONE; So, is there really caching when using repository.save(entity) in a test?
One question for CachingTest: Why the configured @AutoConfigureTestDatabase when they used @MockBean on CarRepository? It won't reach out memory database anyway....am I wrong? Thanks
ANYONE: what is the starting Spring project? What dependencies? I doesn't work on my end. Probably incorrect versions/lack of dependencies on my side. Thanks
Hey does anyone know if there's an equivalent presentation for doing TDD in Spring MVC *without* Boot? Boot seems to be the buzzword of the day but a lot of us work on SpringMVC projects that didn't get Boot for whatever reason. How do we do all this "old school"?
I'm lost with Spring. Why? Because Before we used to init mockMvc with "MockMvcBuilders.webAppContextSetup(this.wac).build()"; wac being "ApplicationContext wac= WebApplicationContextUtils.getRequiredWebApplicationContext(servletConfig.getServletContext());" In general there are too many ways to do the same thing and it always change. Am I wrong ?. And because I have the habit to keep all code that worked for me somewhere, I never know if my knowledge database is already obsolete. : -( Not even know if that demo works nowadays in 2019 and if it's the best practice. What should I do?
I'm facing a problem where the WebMvcTest tries to instantiate every controller within the app and I have to mock all dependencies of every controller on every WebMvcTest 😔 Can someone help me? Here is the stack overflow link stackoverflow.com/questions/64724771/webmvctest-attempts-to-load-every-application-controller
The library was perfectly correct. The offline mode just didn't work for some reason. They should have tried resolve dependencies in the console by the command mvn dependency:resolve and see in the console what went wrong. This is the best what they could do.
Search in google, not knowing the reason of the issue and without the internet, is not the best idea, you know. All other pieces of advice as (mvn clean, close and open) would have hardly helped them as it has nothing to do with reason why maven could not find library in the local repo.
'RED' is a universal color for danger. 'Restarting an APP' when it misbehaves is the universal solution to fix it. Not trying to even consider doing so is unprofessional. When the presenters were out of their home preparation - they sucked miserably.
5:00 Integration test
10:40 Controller Unit testing
13:45 Controller creation
14:46 Service unit testing
19:05 Exception handler creation
25:29 Repository unit testing
51:28 Integration testing
Something that often messes up importing dependencies in IntelliJ is this: in preferences, under Build, Execution, Deployment / Build Tools / Maven / Importing, un-check the checkbox that says "Keep source and test folders on reimport". I don't know who would ever want this checked. It basically makes the IDE ignore when you try to reimport dependencies.
I enjoyed it a lot. But from what I recall, Sonarqube considers a critical issue having private methods in the controllers...
please update to talk about using Jupiter jUnit 5 as the annotations and process is different
Don’t get a purpose of testing repositories instead of larger units like application services or even modules. It is close to the “test-per-class” antipattern. I think we should focus more on testing behavior than implementation :)
I am surprised to see IntelliJ idea instead of STS :-)
Spring Tools Suite has some bugs especially when it comes to compiling, running the project
IntelliJ is IntelliJ! Also the more we are addicted to that, dumber we become, bcz it's so IntelliJent!
Great talk Sannidhi and Madhura, TDD is the way to go!
This is really nice starting point for someone learning testing with Spring.
Is there a github repository for the code shown in the video?
It was given on the last slide. Busted. You didnt watch the entire presentation..😂🤣😅
In the beginning, it was good because I have already seen Phil webb Spring Boot testing session. You guys are also good but network connection or something it get spoiled there. I loved it the beginnning abd now xou can see in teg i ma alos gettngi bda. :P
Thanks for doing presentation on this.
It was good at start, kind of lost interest once network problem started happening and we started into caching. Personally, I also felt we were going too fast with the presentation giving little time to understand what is written.
So good! Comprehensive and all
Great job girls, it was to the point and helpful..
Loved the lived coding and enjoyed it but eventually the issue spoiled the fun. Well done gals
Grate demo and good explanation about various layers of testing, special with mockito.
the best is that voice saying "trying" 25:56
watched for first 20 minutes...its good and fruitful...Thanks!!!
They are working on "Maven Project > Offline Mode = true", that's why the dependency did not download from maven central.
Thanks, I’m gonna check it, cause I had the same issue and I have to close the project and open the pom as a maven project so the dependencies load again in IntelliJ workspace .idea
The driven design part and refactoring part are missing in this video though
@DataJpaTest is itself is annotated with @AutoConfigureCache with @PropertyMapping("spring.cache.type") CacheType cacheProvider() default CacheType.NONE;
So, is there really caching when using repository.save(entity) in a test?
Sometimes intellij is having that problem,missing dependency, you just have to invalidate cache and restart intellij
Excellent video. Same on Spring boot 2 and Junit 5 will be excellent.
Awesome presentation. Thanks a lot for sharing with us.
Very helpful....nicely explained!
It's really hard to watch when you cannot see whole line of code. Why this font is so huge (or screen so small)?
One question for CachingTest: Why the configured @AutoConfigureTestDatabase when they used @MockBean on CarRepository? It won't reach out memory database anyway....am I wrong? Thanks
ANYONE: what is the starting Spring project? What dependencies? I doesn't work on my end. Probably incorrect versions/lack of dependencies on my side. Thanks
If anyone's completed this tutorial, could you provide a link to the pom.xml file?
very good overview for the different levels of testing in a spring boot application
are you guys abandoning spring tool suites? all the demo seems to be done with intellij... I thought you have your own ide..
This speech is amazing. Good job!
thanks for this video
Loved it!
grate explanation, it's really helpful
Hey does anyone know if there's an equivalent presentation for doing TDD in Spring MVC *without* Boot? Boot seems to be the buzzword of the day but a lot of us work on SpringMVC projects that didn't get Boot for whatever reason. How do we do all this "old school"?
If you upload it to GIT, Can you share GIT link?
Good start, but later ahead the code did not work for me
There was too much of confusion later after which I got off the track
Could have done better
I m kind of disappointed that in such TDD presentation you do not start withe the use case scenario. Tha is teh one that define your domain and SUT.
Amazing presentation!
This is super.
too many test annotations ... ...
I would prefer testing the service. We should use @TestConfiguration to create the bean service instead of use MockitoJunitRunner.
I'm lost with Spring. Why? Because Before we used to init mockMvc with "MockMvcBuilders.webAppContextSetup(this.wac).build()"; wac being "ApplicationContext wac= WebApplicationContextUtils.getRequiredWebApplicationContext(servletConfig.getServletContext());" In general there are too many ways to do the same thing and it always change. Am I wrong ?. And because I have the habit to keep all code that worked for me somewhere, I never know if my knowledge database is already obsolete. : -( Not even know if that demo works nowadays in 2019 and if it's the best practice. What should I do?
Read again from the official documentation for every release.. I think it's not only spring but software engineering...
@@ismailyavuz thanks. Yes. Again... And again, and again, and again
good video
/cars/{name} was too generic for the tests they had. only prius was needed...
I'm facing a problem where the WebMvcTest tries to instantiate every controller within the app and I have to mock all dependencies of every controller on every WebMvcTest 😔
Can someone help me? Here is the stack overflow link stackoverflow.com/questions/64724771/webmvctest-attempts-to-load-every-application-controller
I didn't see any of TDD on this video. I only have seen Spring test framework explained.
women... and all is clear.
This is not working in latest spring boot pls update the video
Nice video, however, CrudRepository issue is about incorrect library but not the internet.
The library was perfectly correct. The offline mode just didn't work for some reason. They should have tried resolve dependencies in the console by the command mvn dependency:resolve and see in the console what went wrong. This is the best what they could do.
@@dmitrypotenko4950 the dependecy is incorrect, the correct starter is spring-boot-starter-data, not ... stater-data-jpa
@@dougllassousa9659 mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa
@@dmitrypotenko4950 Oh! that's right! My mistake
Do you really need database for Unit Test ?
Well done Gals you rock
20:38 I do not see the 'st' command in my intellij. Anyone who can explain how?
it's just custom binding
It's a live tempalte. Google intelij live tempales, you can build your own alias for tempales
can u give us git link?
github.com/mbhave/tdd-with-spring-boot
Put the git in the comments please.
24:30 Exception Driven Development.
@@HasNoName69 "kobiety do kodu"
Please show how yo test security stuff.
Do you have source code?
Gaurav Dighe 59:00 they give the link, I haven't tried to access though
Plz attaché source code
The git repos are mentioned at the end of the presentation: github.com/mbhave/tdd-with-spring-boot - github.com/sannidhi/tdd-boot-demo
Great presentation. Please do the speak aging with live coding. And please without any library problem. Full and Clean please.
why not restarting the IDE, close/reopen project, maven clean, or searching google
Search in google, not knowing the reason of the issue and without the internet, is not the best idea, you know. All other pieces of advice as (mvn clean, close and open) would have hardly helped them as it has nothing to do with reason why maven could not find library in the local repo.
Excelent talk, too bad that internet was a problem
Marathi Mulgi.👍
i want to watch this video but i cannot understand the words its indian accent engilish, i just cannot :S
turn on subtitles
'RED' is a universal color for danger. 'Restarting an APP' when it misbehaves is the universal solution to fix it. Not trying to even consider doing so is unprofessional. When the presenters were out of their home preparation - they sucked miserably.
Brahmins Always Lead .. Proud to be A Brahmin ❤️. Our Samaj is Proud of you Madhura🙏🎉🎉
wtf
Good tutorial but not acceptable as successful live coding tutorial because of internet connection scandal or sth in your dependency caching
nick talk, expand my view
2 people trying to explain but none of them can explain it properly. Very poor presentation.