core: update JsonBodyGenerator, remove rest properties of API paths, update assertion

This commit is contained in:
Paul Brodner
2016-12-08 12:46:03 +02:00
parent dc0fb51eb4
commit 2ce29a3abb
2 changed files with 2 additions and 87 deletions
@@ -1,80 +0,0 @@
//package org.alfresco.rest.demo;
//
//import org.alfresco.rest.RestTest;
//import org.alfresco.rest.exception.JsonToModelConversionException;
//import org.alfresco.rest.requests.RestSitesApi;
//import org.alfresco.utility.exception.DataPreparationException;
//import org.alfresco.utility.exception.TestConfigurationException;
//import org.alfresco.utility.model.SiteModel;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.social.alfresco.api.entities.Site.Visibility;
//import org.testng.annotations.BeforeClass;
//import org.testng.annotations.Test;
//
//@Test(groups = { "demo" })
//public class RMDemoTest extends RestTest {
// @Autowired
// RestSitesApi sitesApi;
//
// private SiteModel siteModel;
//
// @BeforeClass(alwaysRun = true)
// public void dataPreparation() throws DataPreparationException {
// siteModel = dataSite.usingAdmin().createPublicRandomSite();
// restClient.authenticateUser(dataUser.getAdminUser());
//
// sitesApi.useRestClient(restClient);
// }
//
// @Test
// public void adminCanSeeDetailsOfARandomSiteCreated() throws JsonToModelConversionException, Exception
// {
// restClient.usingSite(siteModel).getSite()
// .assertThat().field("id").isNotNull()
// .and().field("description").is(siteModel.getDescription())
// .and().field("title").is(siteModel.getTitle());
// }
//
// @Test
// public void adminCanSeeSiteDetailsOfCustomSite() throws JsonToModelConversionException, Exception
// {
// siteModel = dataSite.usingAdmin().createPublicRandomSite();
// siteModel.setDescription("my description");
// siteModel.setVisibility(Visibility.PUBLIC);
//
// // here we create the custom siteModel defined above
// dataSite.usingAdmin().createSite(siteModel);
//
// siteModel
// .assertThat().field("id").isNotNull()
// .and().field("description").is("my description")
// .and().field("title").is("MyTitle")
// .and().field("visibility").is(Visibility.PUBLIC);
// }
//
// /**
// * This will throw this error message:
// * "You missed some configuration settings in your tests: You try to assert field [fieldA] that
// * doesn't exist in class: [org.alfresco.rest.model.RestSiteModel]. Please check your code!"
// */
// @Test(expectedExceptions = TestConfigurationException.class)
// public void assertingWithFieldsThatDoesNotExist() throws JsonToModelConversionException, Exception {
// siteModel = dataSite.createPublicRandomSite();
//
// sitesApi.getSite(siteModel).assertThat().field("fieldA").isNotNull();
// }
//
// @Test
// public void assertingPaginationAndUsingParameters() throws Exception
// {
// /*
// * ~ each API has the possibility to pass parameters to httpMethod call
// * you can use withParams(String... parameters) method before calling the http method.
// */
// sitesApi.withParams("maxItems=2", "orderyBy=name").getSites()
// .assertThat().paginationExist();
//// .and().paginationField("maxItems").is("2");
//
// }
//
//}
+2 -7
View File
@@ -1,17 +1,12 @@
# dataprep related
alfresco.scheme=http
alfresco.server=172.29.100.215
alfresco.port=8080
alfresco.server=vsphered3.qa.internal.alfresco.com
alfresco.port=8070
# credentials
admin.user=admin
admin.password=admin
# rest related
rest.basePath=alfresco/api/-default-/public/alfresco/versions/1
rest.workflowPath=alfresco/api/-default-/public/workflow/versions/1
# TEST MANAGEMENT SECTION - Test Rail
#
# (currently supporting Test Rail v5.2.1.3472 integration)