TAS-188 add RestRequest and sample test

This commit is contained in:
Paul Brodner
2016-08-08 11:07:47 +03:00
parent 87dcc5b7e9
commit 902f6fe271
@@ -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");
}
}