diff --git a/e2e-test/java/org/alfresco/rest/RestDemoTest.java b/e2e-test/java/org/alfresco/rest/RestDemoTest.java
index b9a414fb6..4760e48cc 100644
--- a/e2e-test/java/org/alfresco/rest/RestDemoTest.java
+++ b/e2e-test/java/org/alfresco/rest/RestDemoTest.java
@@ -5,9 +5,9 @@ import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestCommentModel;
import org.alfresco.rest.model.SiteMember;
import org.alfresco.utility.exception.DataPreparationException;
+import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.UserModel;
-import org.apache.chemistry.opencmis.client.api.Document;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.social.alfresco.api.entities.Role;
@@ -61,27 +61,26 @@ public class RestDemoTest extends RestTest
* POST one comment to file using admin user
* Perform GET comments, check the new one is listed
* Update existing comment using PUT call, check that comment content is updated
- *
- * @throws JsonToModelConversionException
+ * @throws Exception
*/
- @Test
- public void commentsTest() throws JsonToModelConversionException, Exception
+ @Test
+ public void commentsTest() throws Exception
{
- Document document = dataContent.usingPath("Shared")
+ FileModel fileModel = dataContent.usingResource("Shared")
.usingUser(userModel)
- .createDocument(DocumentType.TEXT_PLAIN);
+ .createContent(DocumentType.TEXT_PLAIN);
// add new comment
- RestCommentModel commentEntry = commentsAPI.addComment(document.getId(), "This is a new comment");
- commentsAPI.getNodeComments(document.getId())
+ RestCommentModel commentEntry = commentsAPI.addComment(fileModel.getNodeRef(), "This is a new comment");
+ commentsAPI.getNodeComments(fileModel.getNodeRef())
.assertThatResponseIsNotEmpty()
.assertThatCommentWithIdExists(commentEntry.getId())
.assertThatCommentWithContentExists("This is a new comment");
// update comment
- commentEntry = commentsAPI.updateComment(document.getId(),
+ commentEntry = commentsAPI.updateComment(fileModel.getNodeRef(),
commentEntry.getId(),
"This is the updated comment");
- commentsAPI.getNodeComments(document.getId())
+ commentsAPI.getNodeComments(fileModel.getNodeRef())
.assertThatResponseIsNotEmpty()
.assertThatCommentWithIdExists(commentEntry.getId())
.assertThatCommentWithContentExists("This is the updated comment");
@@ -97,7 +96,7 @@ public class RestDemoTest extends RestTest
* @throws JsonToModelConversionException
*/
@Test
- public void siteMembersTest() throws DataPreparationException, JsonToModelConversionException, Exception
+ public void siteMembersTest() throws Exception
{
UserModel newUser = dataUser.createRandomTestUser();
SiteMember siteMember = new SiteMember(Role.SiteConsumer.toString(), newUser.getUsername());
diff --git a/e2e-test/java/org/alfresco/rest/SampleCommentsTest.java b/e2e-test/java/org/alfresco/rest/SampleCommentsTest.java
index ad3f01989..5a50cbc3b 100644
--- a/e2e-test/java/org/alfresco/rest/SampleCommentsTest.java
+++ b/e2e-test/java/org/alfresco/rest/SampleCommentsTest.java
@@ -4,7 +4,6 @@ import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestCommentModel;
import org.alfresco.utility.data.DataUser;
-import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.UserModel;
import org.apache.chemistry.opencmis.client.api.Document;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,15 +23,15 @@ public class SampleCommentsTest extends RestTest
private Document document;
@BeforeClass
- public void initTest() throws DataPreparationException
+ public void initTest() throws Exception
{
userModel = dataUser.getAdminUser();
restClient.authenticateUser(userModel);
commentsAPI.useRestClient(restClient);
- document = dataContent.usingPath("Shared")
+ document = dataContent.usingResource("Shared")
.usingUser(userModel)
- .createDocument(DocumentType.TEXT_PLAIN);
+ .createContent(DocumentType.TEXT_PLAIN);
}
@Test