57:34 he shows how to get to the content order of what he covers, but here are some loose timestamps of talk points 20:00 JUnit 21:00 naming conventions 26:00 domain tests 27:00 Data JPA tests 30:00 testing handcrafted DB queries 43:00 service tests 51:00 @mockbean 52:15 controller tests @mockmvc
I ported all my unit tests to Cucumber for readability purposes last night (single person project, it's nice that I can look at feature files and see what my components were meant to do at a glance). I think I need to libratize some of my code because the security convenience annotations just flat out didn't work. Still having some trouble with post methods as well, but still muddling through why that is, tried turning off CSRF and I was still having issues.
I have written a service layer which will throw UserExistsException, My RestController will call that service, but how to propogate the exception to Controller and then to ResponseEntity. I need to know the Best Practise (Coding Standards) for such things. Please assist.
Good Talk on Testing :-). However, there are other scenarios that weren't covered in this. Especially the scenario where you have an application that uses a third party OAuth2 authentication. We saw the use of `MockMvc` which is fine when you want to access a resource like `/home`. However, with a web application that uses OAuth2, the test won't be able to access that resource as easily. And this would have been good to see.
@@KAUSHIKAKALI I read the article, and followed the steps to the letter, but keep getting errors like ... org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizationTestServer
2024, This video still relevant !!!
Thanks a lot !!!
57:34 he shows how to get to the content order of what he covers, but here are some loose timestamps of talk points
20:00 JUnit
21:00 naming conventions
26:00 domain tests
27:00 Data JPA tests
30:00 testing handcrafted DB queries
43:00 service tests
51:00 @mockbean
52:15 controller tests @mockmvc
Very well-done presentation that gets you started in testing Spring Boot apps!
I ported all my unit tests to Cucumber for readability purposes last night (single person project, it's nice that I can look at feature files and see what my components were meant to do at a glance). I think I need to libratize some of my code because the security convenience annotations just flat out didn't work. Still having some trouble with post methods as well, but still muddling through why that is, tried turning off CSRF and I was still having issues.
I have written a service layer which will throw UserExistsException, My RestController will call that service, but how to propogate the exception to Controller and then to ResponseEntity.
I need to know the Best Practise (Coding Standards) for such things. Please assist.
Good Talk on Testing :-). However, there are other scenarios that weren't covered in this. Especially the scenario where you have an application that uses a third party OAuth2 authentication. We saw the use of `MockMvc` which is fine when you want to access a resource like `/home`. However, with a web application that uses OAuth2, the test won't be able to access that resource as easily. And this would have been good to see.
Here is a good article for testing with OAuth2 www.kaushikbaruah.com/posts/mock-authorization-server-spring-boot-integration-test/
@@KAUSHIKAKALI I read the article, and followed the steps to the letter, but keep getting errors like ... org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizationTestServer
Link to github repo
github.com/philwebb/testing-spring-boot-applications
OMG, 0:54 latest commit 666ae66! That's what I call devil's commit :)
How could your dependencies injection work without @Autowired?
private UserVehicleService service;
20:29
Please add github link
github.com/philwebb/testing-spring-boot-applications