I plan to unit test the webscripts that had Java as controllers. I have found two approaches.
1) Go along the lines of bootstrap code HelloWorldWebScriptControllerTest.java
2) Follow https://github.com/Alfresco/alfresco-remote-api
. Here, the test classes extend org.alfresco.repo.web.scripts.BaseWebScriptTest
.
For the second approach, I tried adding the following dependency, but cannot find this BaseWebScriptTest.
<!-- https://mvnrepository.com/artifact/org.alfresco/alfresco-remote-api --> <dependency> <groupId>org.alfresco</groupId> <artifactId>alfresco-remote-api</artifactId> <version>5.2.b-EA</version> </dependency>
I tried adding <classifier>tests</classifier>
to the above dependency as well. But, cannot find this class.
How can this issue be resolved? Also, which approach is suggested?
In the second approach you are trying to add EA version,which does not exist in the specified url.
You can use another version.
Check by your self on below URL.
I have taken the latest one as well. But, the BaseWebScriptTest is missing. I was wondering if my approach to alfresco-remote-api is correct.
Also, if I follow the first method, I need to mock lot of services as well. How should I mock ServiceRegistry or NodeService?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.