Thank you!! Very very very!!! This topic was so incomprehensible to me that I had problems with my first study project. After watching this tutorial for twenty minutes, I wrote my first integration test and understood how I should be done it in the future. Now I want to write again: THANK YOU! I am now your subscriber
Thank you for sharing your knowledge. You're a great teacher Please make a video on these topics 1. Java 17 features 2. Tips to solve memory problems (like Profiling effectively etc)
Yet again classic JavaTechie video. You will understand everything from A to Z. Also can you please explain us context and reflection API in java and some use case where context is useful
We need Spring Security JWT + Swagger UI (how to integrate them to getter getting the token, secure routes and allowing only who has valid tokens all inside Swagger Web UI) Pleaseeee
Over the years, my career has benefitted tremendously from this channel and a few other channels like @Telusko, in28Minutes, etc. The lesson learned is priceless and I wish to publicly acknowledge you, sir.
Please refer this Spring Security Complete Tutorial with Realtime Example | Facebook Group Usecase | JavaTechie ruclips.net/video/5jDrBD4Y1MI/видео.html
@@Javatechie Since you specified the test application properties to use H2, wouldnt the started database be the H2 database anyway? Or maybe add h2 in pom as test dependency?
Good videao, nice explanation.. I have a question - Suppose now I want to deploy the code in QA or PROD environment. During build it will create , H2 databse in Prod Environemnt in-memory and that will occupy space as well in prod which is not good and can lead to performance issues...Please suggest on this...
@@Javatechie But for test container you need Docker. Without docker it wont be possible to run test containers in local and the code build will fail if one dont have docker installed. Now if we need to depoy out code in prod environment , then just for running Integration Test case in Prod environment we need to have docker and that is more space-consuming and vulnerable to security threats for a prod environment...
Hi Basant, if I am not wrong we should call the actual repository with fake database right. In large projects we put all the SQL statements in one SQL file and will execute the integration tests with activating test profile.
@@Javatechie thanks for your reply Basant.. no I am not saying we should hit the actual database, we should hit the actual repository class that connects to fake database with test profile activated. This way we will test the actual behaviour of the application.
Hi JavaTechie, Good day to you. Suppose we are making a REST API call to another service(microservice) from our service layer. My question is how to write a test case for testing external API call.
If we are using spring security over here. Then how we will bypass that to hit controller. Not only the URL pattern. Suppose we are trying to check the security context object as well in our controller class.
I guess this is one of the most demanded topic. ✅ Right in the middle. 👍
Thank you!! Very very very!!!
This topic was so incomprehensible to me that I had problems with my first study project. After watching this tutorial for twenty minutes, I wrote my first integration test and understood how I should be done it in the future.
Now I want to write again: THANK YOU! I am now your subscriber
Thanks Michael good to know that.keep learning
Thank you for sharing your knowledge. You're a great teacher
Please make a video on these topics
1. Java 17 features
2. Tips to solve memory problems (like Profiling effectively etc)
Yet again classic JavaTechie video. You will understand everything from A to Z.
Also can you please explain us context and reflection API in java and some use case where context is useful
We need Spring Security JWT + Swagger UI (how to integrate them to getter getting the token, secure routes and allowing only who has valid tokens all inside Swagger Web UI) Pleaseeee
He already has a tutorial on JWT authentication.
Very nice video regarding junit 5 integration testing using spring boot... thanks brother
You are amazing, Thank you so much for such great tutorials.
Very good explanations with good quality content
You are amazing, always came with amazing content thank u sir!
Over the years, my career has benefitted tremendously from this channel and a few other channels like @Telusko, in28Minutes, etc. The lesson learned is priceless and I wish to publicly acknowledge you, sir.
I agree
Was waiting for these.
great tutorial for beginner
Awesome explanation!!
Awesome content,,,, your explaination is awesome sir. 😍
Pls make a detailed video on Spring Security!
Please refer this Spring Security Complete Tutorial with Realtime Example | Facebook Group Usecase | JavaTechie
ruclips.net/video/5jDrBD4Y1MI/видео.html
Nice explaination..
Thanks bro....very well explained 👍
Pleasee Keep going we need BDD, E2E Testing Please and thank you
Thank you
You are amazing, always came with amazing content thank u 🙂
Fantastic! Saved me hours of work! 😍
great tutorial
Superb as always!! But how to test private methods in service layers. any video on that if you have posted.
We need to use power mock
@@Javatechie Ok Thank you.
I will prepare a video of it don't worry
superb man!
Greatful
Waiting for ur video..
Could you please Upload Videos on Rest Micro Services
Please checkout my microservice playlist
Thank you. You are the best.
Good videos
Why is TestH2Repository interface introduced instead of using the existing ProductRepository interface ?
Moral of this integration test to not touch actual database hence I created one in memory db in test cases which is TestH2Repoditory
@@Javatechie I think this is achievable using ProductRepository also, right ?
@@pujankc6822 Yes, using the @MockMvc annotation.
thank you great video, only for test method findById for more cases id is auto increment, and you don't now exactly id
Yes exactly but you can assert that field as not null
🤩🤩🤩
Very good video. One small question, why you didn't you use TestRestTemplate ?
Great thanks
Why are u creating TestH2Repository? Couldnt you Autowire and use Product repository?
For test case we shouldn’t hit application databases we should use test database
@@Javatechie Since you specified the test application properties to use H2, wouldnt the started database be the H2 database anyway?
Or maybe add h2 in pom as test dependency?
You need to add h2 dependency in Pom so that while starting test context it will start embedded h2
Good videao, nice explanation.. I have a question - Suppose now I want to deploy the code in QA or PROD environment. During build it will create , H2 databse in Prod Environemnt in-memory and that will occupy space as well in prod which is not good and can lead to performance issues...Please suggest on this...
That's correct but you can assure that all your functionality is working but if you will think about memory then better to use Test container
@@Javatechie But for test container you need Docker. Without docker it wont be possible to run test containers in local and the code build will fail if one dont have docker installed. Now if we need to depoy out code in prod environment , then just for running Integration Test case in Prod environment we need to have docker and that is more space-consuming and vulnerable to security threats for a prod environment...
@@saumitrasaxena8470 deployment world has been changed buddy I don't think there is any application go live in prod without containers.
Hi Basant, if I am not wrong we should call the actual repository with fake database right. In large projects we put all the SQL statements in one SQL file and will execute the integration tests with activating test profile.
No Praveen it's bad practice to hit actual database for your test case
@@Javatechie thanks for your reply Basant.. no I am not saying we should hit the actual database, we should hit the actual repository class that connects to fake database with test profile activated. This way we will test the actual behaviour of the application.
Ohh got it yes we can do that ☺️
Thank you! please I have a question how to use the same approach @sql in a case where we are using querydsl ?!
Not sure buddy let me check
Querydsl still using in project na?
Did u find anything on this ?
@javaTechie can we have videos on websocket with messaging queue . noone has done videos on websockets java with stompsessions
@Java Techie ruclips.net/user/JavaTechie
I uploaded one messaging app using web socket please have a look
Hi JavaTechie, Good day to you. Suppose we are making a REST API call to another service(microservice) from our service layer. My question is how to write a test case for testing external API call.
Same way you need to follow,from test case using rest template you need to invoke your controller endpoint
@@Javatechie Can you please make video on wiremock.
Okay i will check this
If we are using spring security over here. Then how we will bypass that to hit controller. Not only the URL pattern. Suppose we are trying to check the security context object as well in our controller class.
You need to mock SecurityContextHolder i will check and update proper syntax
Very good explanation but Quality is not good its blurry and Quality option is disabled
Punya it depends internet speed. It support resolution 1080 P HD
If we are using a feign client to get data from another microservice then how to mock for integration test...?
Hadoop with Kerberos setup with multi node please create one video
why static void instead of normal init() method???
You should never include word update and delete in the path.
Yes agreed, we need to play with the http method with base URL
For H2 dB, how to define schema name using application.yml
How to create Kerberos authentication using spring boot ?
Never tried this will check and update you
instead of h2 repository can we use properties file ?
No it's not recommended at all
Bro, if we use storedProc in the Realtime, can we do same testing ?
Yes why not we can.see at the end it will just invoke your controller then the process of flow is as it is
Which company you(Basant) are working?
Do the same thing using mockito
Hi Basant I tried to run mvn clean install so out of 5 tests 3 are failing. Can you please help us on this.
I guess reason is in first test case one record will get insert and it never be deleted in code
1st comment
Thank you