AnsweredAssumed Answered

Unit test cases for Java Controller based Webscripts in Alfresco

Question asked by sarakahn on Mar 4, 2019
Latest reply on Mar 5, 2019 by krutik.jayswal

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?

Outcomes