Hi Community,
I'm trying to write my Unit test for a model created to interact with the MagentoGraphqlClient Object.
My doubt here comes when I need to inject a mocked object using the @Deleted Account annotation.
@Self(injectionStrategy = InjectionStrategy.OPTIONAL)
private MagentoGraphqlClient magentoGraphqlClient;
Also for a CIF Model that is being called within my custom model.
@Self(injectionStrategy = InjectionStrategy.OPTIONAL)
@Via(type = ResourceSuperType.class)
private com.adobe.cq.commerce.core.components.models.productlist.ProductList productList;
Does anybody have any idea how can I inject these mocked objects and interact with the returning values within my Model?
Regards.
Views
Replies
Total Likes
Hi @naxtyn__1
Please check if this helps: https://adapt.to/content/dam/adaptto/production/presentations/2015/150929-wcm-io-unit-test-and-mocki...
Regards,
Santosh
Thanks for sharing this information, I did take a look before but this is not providing too much information about this case.
Hi,
Please check https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/junit-test-cases-for-sling...
Views
Likes
Replies
Views
Likes
Replies