Hi,
any example to unit test
contentElement.getValue().getValue(String[].class);
I am getting io.wcm unsupported operation exception, when trying to unit test this specific line of code.
Thanks,
Sri
Solved! Go to Solution.
Views
Replies
Total Likes
Yeah I got this problem too, I fixed it by refactoring the code, and broke it up.
String[] cfNamesArray = contentFragment.map(cf -> cf.getElement("names")).map(ContentElement::getContent)
.filter(StringUtils::isNotEmpty)
.map(names -> names.split(","))
.orElse(null);
See mock fragment data section on
Yeah I got this problem too, I fixed it by refactoring the code, and broke it up.
String[] cfNamesArray = contentFragment.map(cf -> cf.getElement("names")).map(ContentElement::getContent)
.filter(StringUtils::isNotEmpty)
.map(names -> names.split(","))
.orElse(null);
Hello @sreenu539 -
I see the same has been reported here https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/java-lang-unsupportedopera...
Looks like these methods are not supported yet with the wcm.io mocking library & I see the issue is listed here https://github.com/wcm-io/io.wcm.testing.aem-mock/issues/15 still in progress.