Updates to sanity suite, remove sample tests

This commit is contained in:
Valentin Popa
2016-08-24 15:03:12 +03:00
parent 5f2937197c
commit b7e64e0851
3 changed files with 2 additions and 93 deletions
@@ -1,40 +0,0 @@
package org.alfresco.rest.v1;
import org.alfresco.rest.RestSitesApi;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class SampleATest extends RestTest
{
@Autowired
RestSitesApi siteAPI;
@BeforeClass
public void initTest()
{
siteAPI.useRestClient(restClient);
}
@Test(groups = {"rest-api-v1", "sanity"})
public void sampleATestMethod1() throws JsonToModelConversionException
{
UserModel admin = new UserModel("admin", "admin");
restClient.authenticateUser(admin);
Assert.assertFalse(siteAPI.getSites().getEntries().isEmpty(), "We have sites");
}
@Test(groups = {"rest-api-v1", "sanity"})
public void sampleATestMethod2() throws JsonToModelConversionException
{
UserModel admin = new UserModel("admin", "a");
restClient.authenticateUser(admin);
Assert.assertTrue(siteAPI.getSites().getEntries().isEmpty(), "We have sites");
Assert.assertEquals(siteAPI.usingRestWrapper().getLastStatus().getName().toLowerCase(), HttpStatus.UNAUTHORIZED.name().toLowerCase(), "Status Code Name");
}
}
@@ -1,50 +0,0 @@
package org.alfresco.rest.v1;
import org.alfresco.rest.RestSitesApi;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class SampleBTest extends RestTest
{
@Autowired
RestSitesApi siteAPI;
@BeforeClass
public void initTest()
{
siteAPI.useRestClient(restClient);
}
@Test(groups = { "rest-api-v1", "sanity" })
public void sampleBTestMethod1() throws JsonToModelConversionException
{
UserModel admin = new UserModel("admin", "admin");
restClient.authenticateUser(admin);
Assert.assertFalse(siteAPI.getSites().getEntries().isEmpty(), "We have sites");
}
@Test(groups = { "rest-api-v1", "sanity" })
public void sampleBTestMethod2() throws JsonToModelConversionException
{
UserModel admin = new UserModel("admin", "a");
restClient.authenticateUser(admin);
Assert.assertTrue(siteAPI.getSites().getEntries().isEmpty(), "We have sites");
Assert.assertEquals(siteAPI.usingRestWrapper().getLastStatus().getName().toLowerCase(), HttpStatus.UNAUTHORIZED.name().toLowerCase(),
"Status Code Name");
}
@Test(groups = { "rest-api-v1" })
public void getSite() throws JsonToModelConversionException
{
UserModel admin = new UserModel("admin", "admin");
restClient.authenticateUser(admin);
Assert.assertEquals(siteAPI.getSite("0-C2291-1470305685222").getId(), "no-id");
}
}