AEM Tutorial #23 | Sling Model Unit Testing | Unit Test for Sling Model using JUnit 5 and AEM Mocks

  Рет қаралды 28,794

AEM GEEKS

AEM GEEKS

Күн бұрын

Пікірлер: 48
@pawangodwani7072
@pawangodwani7072 4 жыл бұрын
You tutorials are in depth and up to the mark...they are just more than expected... Appreciate your efforts 👍
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Thanks pawan godwani. I always keeps myself as a viewer while creating any tutorial.
@varunpratapsingh6058
@varunpratapsingh6058 3 жыл бұрын
Thanks for such an easy to understand in depth tutorial, really appreciate the hard work, sir. Eagerly waiting for Junit testing for services, servlets and other backend classes, hope to see those after current series gets over. Thank you for sharing such valuable knowledge!
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Thanks Varun Pratap Singh, Sure I will try to create those tutorials. I am occupied these days. From next month, I will start posting tutorials regularly
@mdshussain6449
@mdshussain6449 3 жыл бұрын
Thank you... your way of explaining with example is really commendable... excellent !... :)
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Thanks Md S Hussain, I have started a another series for unit for other modules. Please have a look. kzbin.info/www/bejne/kIjWeZuKfp2bbLs
@priyankamalviya3613
@priyankamalviya3613 3 жыл бұрын
very helpful turotial @AEM GEEKS - thank you!
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Thanks Priyanka Malviya, There are tutorials available for unit test for other backend modules like servlet, services, osgi configurations. You can explore those as well if needed. kzbin.info/www/bejne/kIjWeZuKfp2bbLs
@SebastianUnterberg
@SebastianUnterberg 3 жыл бұрын
Thank you for doing an amazing tutorial here. You showed me allot.
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Thank you! Sebastian Unterberg
@WisdomofHal
@WisdomofHal 4 жыл бұрын
This is such a great tutorial. Nice work!
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Thanks FiberHive
@RupalJain-vd6pe
@RupalJain-vd6pe Жыл бұрын
Hi, thank you for all your videos on AEM. I just wanted to ask if you have covered the scenario where we extend the core components in our custom components, but do override methods in our Impl class, rather use the variables directly from core components. Ex- I have extended Image component, and I am using image.src directly in HTL by calling Image core model in HTML using data-sly-use. Please let me know. Many thanks in advance !
@aishwaryjain7807
@aishwaryjain7807 Жыл бұрын
Hi Sir..one pproblem i.e I am facing nullpointerexception while calling the the interface in test class..pls suggest the solution
@naveena6992
@naveena6992 3 жыл бұрын
thank you, for this wonderfull explanation
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Thanks Naveen A
@lohit9098
@lohit9098 3 жыл бұрын
Thanks for creating this tutorial. Please create tutorial on jUnit testing for Services and listeners as well.
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Yes Lohit Kumar, We will have complete separate series/play for unit testing for all back end modules. Currently I am running series for workflow. I will try to plan this after current series.
@jhansitenali
@jhansitenali Жыл бұрын
Hi, Thanks for the video, but i am looking for the integration testing tutorials the tests that we write under it.tests folder. Can you give me some pointers if you have any. Thanks in advance
@saurabhsingh-gk7ks
@saurabhsingh-gk7ks 4 жыл бұрын
Thank you so much.
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Always welcome saurabh singh. I am glad you liked tutorial.
@udaykumarvg7119
@udaykumarvg7119 4 жыл бұрын
Can we expect the tutorial on unit test for sling servlets and resources also.
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Uday Kumar VG, I will definitely create tutorial of unit testing for servlet and other back end modules once I have explained those topics. So once I done with servlet related tutorials, I will explain unit test for servlet. I am trying to write/create tutorials in order so that you can follow tutorials and learn in order.
@deltaprince8411
@deltaprince8411 2 жыл бұрын
Hi Sir, I am facing issue while loading json, it is showing unable to secure processing, Junit test fails with SAXNotRecognizedException.
@AEMGeeks
@AEMGeeks 2 жыл бұрын
Really not sure. Add completed error.
@lucasdaschagas
@lucasdaschagas Жыл бұрын
Add Xerces dependency
@rishidhone4529
@rishidhone4529 2 жыл бұрын
hi mate can you please tell solution for "Resource does not exist" as all my json files are also proper and following required steps
@AEMGeeks
@AEMGeeks 2 жыл бұрын
Something is missing. Can't comment unless see all logs. You can take my repo. Just build at your machine and check
@DBFastfuninfo
@DBFastfuninfo 4 жыл бұрын
Nice sir👌
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Thanks @Bond05, Your tutorials is also published now.
@DBFastfuninfo
@DBFastfuninfo 4 жыл бұрын
@@AEMGeeks thanks a lot sir
@deepikaanagesh7181
@deepikaanagesh7181 3 жыл бұрын
your tutorial was simple and great start for beginners. thank you . i have doubt,how do we cover the logic inside init method
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Deepikaa nagesh, Did I not cover this in tutorial. If I did not, I will start a separate series only for unit testing for all backend modules/components like servlet, scheduler, service. I will cover this use case in this series.
@deepikaanagesh7181
@deepikaanagesh7181 3 жыл бұрын
@@AEMGeeks thank you.
@barkhasharma295
@barkhasharma295 3 жыл бұрын
Sir, how is it possible that test is failed and code coverage is 100%? Also, how to make sure that NullPointerException can be avoided? How to resolve this?
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Both same time can't be possible. If you have multiple methods with no testing code, you method can pass. if any method failed, you can see failed result. Please check line covered/coverage. For null pointer exception, Please check method/service access. If they are really accessible. I will encourage you to check junit playlist once here. kzbin.info/aero/PLEaEQSM_Y4tl9wy04IpjNKoiTihjb8ajp
@chandramohan7689
@chandramohan7689 4 жыл бұрын
Nice work. Thanks a lot for sharing the knowledge. Small doubt, In every use case we are just checking fixed/static content, like name is AEM/AEM geeks and array list size is 4..etc. But authors will author the page with different name and values, how this use cases help to address different values enter in dialog? Could you pls explain?
@AEMGeeks
@AEMGeeks 4 жыл бұрын
Chandramohan, This is unit test case. In unit tests, you always know what is your input and what is expected output. We are testing out functions/methods here. We are not doing functional testing here. In unit test case, you always know what is your input and what expected output. You always match expected output and actual output. If you want to change something update json. It looks, you are confuse between functionality testing and unit testing. What you are talking about functionality testing. Functional/QA test cases are always written by QA team. This is unit test cases are always written by developer. Please understand difference. Please let me know if you have doubt.
@chandramohan7689
@chandramohan7689 4 жыл бұрын
@@AEMGeeks thnks for explanation.
@mohitsrivastava9793
@mohitsrivastava9793 3 жыл бұрын
instead of '/component' as resource can i use any other thing as well. its just storing my json file in that resource right?
@AEMGeeks
@AEMGeeks 3 жыл бұрын
Correct Mohit Srivasstava, you can use any name. It just a name to access that resource json.
@mohitsrivastava9793
@mohitsrivastava9793 3 жыл бұрын
@@AEMGeeks thank you. Also, I've followed exactly same steps but I'm getting null pointer exception error when I'm using similar statement to author.getFirstName() in my project. Can you tell how can I resolve that. I tried Author author; inside the function body, but that didn't resolved the problem
@AEMGeeks
@AEMGeeks 3 жыл бұрын
you might be missing something. can you please take demo code from git repo and verify. github.com/aemgeeks1212/aemgeeks
@anatoli3866
@anatoli3866 3 жыл бұрын
@@mohitsrivastava9793 I had same issue and the problem was my @PostConstruct init() method. After i remove it all begin to work.
@harshalpatne765
@harshalpatne765 2 жыл бұрын
How can we test a component which doesn't have a dialogue
@AEMGeeks
@AEMGeeks 2 жыл бұрын
Yes, you can. If you have something in repository to test.
@rishidhone4529
@rishidhone4529 2 жыл бұрын
where is /component is available ?
@AEMGeeks
@AEMGeeks 2 жыл бұрын
component is under aemgeeks project. Are you referencing something else
JUnit 5 with Mocking Workshop | Online Training | Ashok IT
3:52:00
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Java Unit Testing with JUnit - Tutorial - How to Create And Use Unit Tests
21:35
The Return of Procedural Programming - Richard Feldman
52:53
ChariotSolutions
Рет қаралды 62 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН