mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-08 14:51:20 +00:00
upgrade to TasProperties
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package org.alfresco.rest;
|
package org.alfresco.rest;
|
||||||
|
|
||||||
|
import org.alfresco.tester.ServerHealth;
|
||||||
|
import org.alfresco.tester.TasProperties;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||||
@@ -13,9 +15,17 @@ public class BaseRestTest extends AbstractTestNGSpringContextTests
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected RestProperties restProperties;
|
protected RestProperties restProperties;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected TasProperties properties;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected ServerHealth serverHealth;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public void setup()
|
public void setup() throws Exception
|
||||||
{
|
{
|
||||||
|
serverHealth.assertIfServerOnline();
|
||||||
|
|
||||||
RestAssured.baseURI = restProperties.envProperty().getTestServerUrl();
|
RestAssured.baseURI = restProperties.envProperty().getTestServerUrl();
|
||||||
RestAssured.port = restProperties.envProperty().getPort();
|
RestAssured.port = restProperties.envProperty().getPort();
|
||||||
RestAssured.basePath = restProperties.getRestBasePath();
|
RestAssured.basePath = restProperties.getRestBasePath();
|
||||||
|
@@ -12,14 +12,14 @@ public class SampleATest extends BaseRestTest
|
|||||||
@Autowired
|
@Autowired
|
||||||
RestSites onSites;
|
RestSites onSites;
|
||||||
|
|
||||||
@Test
|
@Test(groups = {"rest-api-v1", "sanity"})
|
||||||
public void sampleATestMethod1()
|
public void sampleATestMethod1()
|
||||||
{
|
{
|
||||||
UserModel admin = new UserModel("admin", "admin");
|
UserModel admin = new UserModel("admin", "admin");
|
||||||
Assert.assertFalse(onSites.withAuthUser(admin).getSites().getEntries().isEmpty(), "We have sites");
|
Assert.assertFalse(onSites.withAuthUser(admin).getSites().getEntries().isEmpty(), "We have sites");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(groups = {"rest-api-v1", "sanity"})
|
||||||
public void sampleATestMethod2()
|
public void sampleATestMethod2()
|
||||||
{
|
{
|
||||||
UserModel admin = new UserModel("admin", "a");
|
UserModel admin = new UserModel("admin", "a");
|
||||||
|
@@ -12,14 +12,14 @@ public class SampleBTest extends BaseRestTest
|
|||||||
@Autowired
|
@Autowired
|
||||||
RestSites onSites;
|
RestSites onSites;
|
||||||
|
|
||||||
@Test
|
@Test(groups = {"rest-api-v1", "sanity"})
|
||||||
public void sampleBTestMethod1()
|
public void sampleBTestMethod1()
|
||||||
{
|
{
|
||||||
UserModel admin = new UserModel("admin", "admin");
|
UserModel admin = new UserModel("admin", "admin");
|
||||||
Assert.assertFalse(onSites.withAuthUser(admin).getSites().getEntries().isEmpty(), "We have sites");
|
Assert.assertFalse(onSites.withAuthUser(admin).getSites().getEntries().isEmpty(), "We have sites");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(groups = {"rest-api-v1", "sanity"})
|
||||||
public void sampleBTestMethod2()
|
public void sampleBTestMethod2()
|
||||||
{
|
{
|
||||||
UserModel admin = new UserModel("admin", "a");
|
UserModel admin = new UserModel("admin", "a");
|
||||||
@@ -29,7 +29,7 @@ public class SampleBTest extends BaseRestTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test(groups = {"rest-api-v1"})
|
||||||
public void getSite()
|
public void getSite()
|
||||||
{
|
{
|
||||||
UserModel admin = new UserModel("admin", "admin");
|
UserModel admin = new UserModel("admin", "admin");
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||||
<suite name="Suite" parallel="classes">
|
<suite name="Suite" parallel="classes">
|
||||||
|
<listeners>
|
||||||
|
<listener class-name="org.alfresco.tester.report.ReportListenerAdapter"></listener>
|
||||||
|
</listeners>
|
||||||
<test name="Test">
|
<test name="Test">
|
||||||
<classes>
|
<classes>
|
||||||
<class name="org.alfresco.rest.SampleATest"></class>
|
<class name="org.alfresco.rest.SampleATest"></class>
|
||||||
|
Reference in New Issue
Block a user