I have added details of the issue on below link.
Can you please let me know if I am missing anything.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @ks_hitijingole,
From the log statement, resource named "componentResource" that you are injecting in the model is null. (which is the starting point in the getFaqQuestionAnswerArray() method) because of this it a NPE on getFaqQuestionAnswerArray() method from the test class.
Could you please share your
You can go through this tutorial to assert for Arrays
Views
Replies
Total Likes
can you please re-check whatever you are configuring on the dialog is configured on the JSON file?
there should not be any variable miss inside the json.
Hi @ks_hitijingole,
From the log statement, resource named "componentResource" that you are injecting in the model is null. (which is the starting point in the getFaqQuestionAnswerArray() method) because of this it a NPE on getFaqQuestionAnswerArray() method from the test class.
Could you please share your
Could you please share test json as well?
Views
Replies
Total Likes
Hi,
There was an issue in your model class., you have to use @Deleted Account annotation to inject componentResource
/** The accoridonArray node */
@Deleted Account
Resource componentResource;
can you try with https://github.com/arunpatidar02/aem63app-repo/tree/master/java/junit/faq
Views
Replies
Total Likes
Hi @arunpatidar, @Vijayalakshmi_S sharing the Mock Json and component node structure below.
PS : There is a known typo in Node Name "accoridonArray"
Views
Replies
Total Likes
Hi @ks_hitijingole,
Per the node structure and mock JSON, could see that componentResource is not available in your mock JSON as said earlier.
Also, looks like you are using multifield to author the questions/answers part of accordion where accordionArray is the multifield node.
In order to retrieve the same, you can use Injector Specific Annotation named @ChildResource (org.apache.sling.models.annotations.injectorspecific.ChildResource)
@ChildResource
private List<Resource> accordionArray;
Revise the Sling Model accordingly and for framing mock JSON you can access the path using infinity.json and use that in the JSON file.
Example :
In this case per the code snippet you shared,
If this path - /content/<PATH>/us/en/home/jcr:content/faq (faq node) has the sling:resourceType to be "roche/diagnostics/components/faq", then
If you still face any issues, please update this thread with complete details of the component.
Views
Replies
Total Likes
Views
Likes
Replies