mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Updates to sanity suite, remove sample tests
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,14 +2,13 @@
|
||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||
<suite name="Suite" parallel="classes">
|
||||
<listeners>
|
||||
<listener class-name="org.alfresco.tester.report.ReportListenerAdapter"></listener>
|
||||
<listener class-name="org.alfresco.utility.report.ReportListenerAdapter"></listener>
|
||||
</listeners>
|
||||
<test name="Test">
|
||||
<classes>
|
||||
<class name="org.alfresco.rest.v1.SampleATest"></class>
|
||||
<class name="org.alfresco.rest.v1.SampleBTest"></class>
|
||||
<class name="org.alfresco.rest.v1.SamplePeopleTest"></class>
|
||||
<class name="org.alfresco.rest.v1.SampleSitesTest"></class>
|
||||
<class name="org.alfresco.rest.v1.SampleCommentsTest"></class>
|
||||
</classes>
|
||||
|
||||
</test> <!-- Test -->
|
||||
|
||||
Reference in New Issue
Block a user