TAS-188 add support for wrapper (single,collection jsons)

This commit is contained in:
Paul Brodner
2016-08-04 12:20:11 +03:00
parent 2c8dcec779
commit d3507fa904
2 changed files with 16 additions and 3 deletions
@@ -10,7 +10,6 @@ import com.jayway.restassured.RestAssured;
@ContextConfiguration("classpath:alfresco-restapi-context.xml")
public class BaseRestTest extends AbstractTestNGSpringContextTests
{
@Autowired
protected RestProperties restProperties;
@@ -1,19 +1,33 @@
package org.alfresco.rest.v1;
import static org.alfresco.rest.RestClientWrapper.onRestAPI;
import static org.alfresco.rest.RestWrapper.onRestAPI;
import java.io.IOException;
import org.alfresco.rest.BaseRestTest;
import org.alfresco.tester.model.UserModel;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
public class SitesTest extends BaseRestTest
{
@Test
public void getSite()
{
UserModel admin = new UserModel("admin", "admin");
System.out.println(onRestAPI().withAuthUser(admin).onSites().getSite("SiteName1470151654495").getTitle());
}
@Test
public void getSites() throws JsonParseException, JsonMappingException, IOException
{
UserModel admin = new UserModel("admin", "admin");
Assert.assertEquals(onRestAPI().withAuthUser(admin).onSites().getSites().getPagination().getTotalItems(), 281);
Assert.assertEquals(onRestAPI().withAuthUser(admin).onSites().getSites().getEntries().get(0).onModel().getTitle(), "0-C2291-1470255221170");
}
}