1

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?

Sara
  • 603
  • 8
  • 19

1 Answers1

0

Use the bootstrap code example. It is simple and it works. I see no reason to make it any more complicated.

However, if you look at the Alfresco source, you'll see that class under ./projects/repository/source/test-java/org/alfresco/repo/web/scripts/BaseWebScriptTest.java

Jeff Potts
  • 10,468
  • 17
  • 40