mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
TAS-188 add RestRequest and sample test
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package org.alfresco.rest.v1;
|
||||
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.v1.RestSitesApi;
|
||||
import org.alfresco.tester.data.DataSite;
|
||||
import org.alfresco.tester.data.DataUser;
|
||||
import org.alfresco.tester.exception.DataPreparationException;
|
||||
@@ -30,7 +29,7 @@ public class SampleSitesTest extends RestTest
|
||||
@BeforeClass
|
||||
public void initTest() throws DataPreparationException
|
||||
{
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
userModel = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(userModel);
|
||||
siteModel = dataSite.createPublicRandomSite();
|
||||
siteAPI.useRestClient(restClient);
|
||||
@@ -67,5 +66,21 @@ public class SampleSitesTest extends RestTest
|
||||
siteAPI.getSites().assertPagination();
|
||||
Assert.assertEquals(siteAPI.getSites().getPagination().getCount(), 100);
|
||||
}
|
||||
|
||||
@Autowired RestCommentsApi commentsAPI;
|
||||
@Test
|
||||
public void getComments() throws JsonToModelConversionException
|
||||
{
|
||||
commentsAPI.useRestClient(restClient);
|
||||
System.out.println(commentsAPI.getNodeComments("bc95c7bf-0593-422f-af7d-b92f9d8129de").getEntries().size());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void addComments() throws JsonToModelConversionException
|
||||
{
|
||||
commentsAPI.useRestClient(restClient);
|
||||
commentsAPI.addCommentToNode("bc95c7bf-0593-422f-af7d-b92f9d8129de");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user