TAS-387 Add support for JSON schema validation

This commit is contained in:
Valentin Popa
2016-09-02 10:47:16 +03:00
parent da16d2c241
commit d341d02aee
4 changed files with 14 additions and 16 deletions

View File

@@ -65,7 +65,7 @@ public class RestDemoTest extends RestTest
* @throws JsonToModelConversionException
*/
@Test
public void commentsTest() throws JsonToModelConversionException
public void commentsTest() throws JsonToModelConversionException, Exception
{
Document document = dataContent.usingPath("Shared")
.usingUser(userModel)
@@ -97,7 +97,7 @@ public class RestDemoTest extends RestTest
* @throws JsonToModelConversionException
*/
@Test
public void siteMembersTest() throws DataPreparationException, JsonToModelConversionException
public void siteMembersTest() throws DataPreparationException, JsonToModelConversionException, Exception
{
UserModel newUser = dataUser.createRandomTestUser();
SiteMember siteMember = new SiteMember(Role.SiteConsumer.toString(), newUser.getUsername());

View File

@@ -36,7 +36,7 @@ public class SampleCommentsTest extends RestTest
}
@Test
public void addComments() throws JsonToModelConversionException
public void addComments() throws JsonToModelConversionException, Exception
{
commentsAPI.addComment(document.getId(), "This is a new comment");
commentsAPI.usingRestWrapper()
@@ -52,7 +52,7 @@ public class SampleCommentsTest extends RestTest
}
@Test
public void updateComment() throws JsonToModelConversionException
public void updateComment() throws JsonToModelConversionException, Exception
{
// add initial comment
String commentId = commentsAPI.addComment(document.getId(), "This is a new comment").getId();

View File

@@ -1,7 +1,5 @@
package org.alfresco.rest;
import org.alfresco.rest.RestPeopleApi;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.UserModel;
@@ -30,7 +28,7 @@ public class SamplePeopleTest extends RestTest
}
@Test
public void getPersonCheckResponseAndStatus() throws JsonToModelConversionException
public void getPersonCheckResponseAndStatus() throws Exception
{
peopleAPI.getPerson(userModel.getUsername())
.assertResponseIsNotEmpty();
@@ -40,7 +38,7 @@ public class SamplePeopleTest extends RestTest
}
@Test
public void getPersonCheckStatusCode1() throws JsonToModelConversionException
public void getPersonCheckStatusCode1() throws Exception
{
peopleAPI.getPerson(userModel.getUsername())
.assertPersonHasName(userModel.getUsername());

View File

@@ -37,13 +37,13 @@ public class SampleSitesTest extends RestTest
}
@Test
public void getSiteResponseNotNull() throws JsonToModelConversionException
public void getSiteResponseNotNull() throws JsonToModelConversionException, Exception
{
siteAPI.getSite(siteModel.getId()).assertResponseIsNotEmpty();
}
@Test
public void getSiteCheckStatusCode() throws JsonToModelConversionException
public void getSiteCheckStatusCode() throws JsonToModelConversionException, Exception
{
siteAPI.getSite(siteModel.getId());
siteAPI.usingRestWrapper()
@@ -51,14 +51,14 @@ public class SampleSitesTest extends RestTest
}
@Test
public void getSitesResponseNotEmpty() throws JsonToModelConversionException
public void getSitesResponseNotEmpty() throws JsonToModelConversionException, Exception
{
siteAPI.getSites()
.assertThatResponseIsNotEmpty();
}
@Test
public void getSitesCheckStatusCode() throws JsonToModelConversionException
public void getSitesCheckStatusCode() throws JsonToModelConversionException, Exception
{
siteAPI.getSites();
siteAPI.usingRestWrapper()
@@ -66,13 +66,13 @@ public class SampleSitesTest extends RestTest
}
@Test
public void sitesCollectionHasPagination() throws JsonToModelConversionException
public void sitesCollectionHasPagination() throws JsonToModelConversionException, Exception
{
siteAPI.getSites().assertResponseHasPagination();
}
@Test
public void addMemberToSiteCheckStatusCode() throws JsonToModelConversionException, DataPreparationException
public void addMemberToSiteCheckStatusCode() throws JsonToModelConversionException, DataPreparationException, Exception
{
UserModel newMember = dataUser.createRandomTestUser();
SiteMember siteMember = new SiteMember(Role.SiteCollaborator.toString(),
@@ -84,14 +84,14 @@ public class SampleSitesTest extends RestTest
}
@Test
public void isSiteReturned() throws JsonToModelConversionException
public void isSiteReturned() throws JsonToModelConversionException, Exception
{
siteAPI.getAllSites()
.assertThatResponseHasSite(siteModel.getId());
}
@Test
public void checkSiteDetails() throws JsonToModelConversionException
public void checkSiteDetails() throws JsonToModelConversionException, Exception
{
siteAPI.getSite(siteModel.getId())
.assertResponseIsNotEmpty()