Files
SearchServices/e2e-test/java/org/alfresco/rest/audit/AuditTest.java
T
Alexandru-Eusebiu Epure 83d44e474c REPO-2582 Retrieve Audit Applications - add TAS-level test
Add core tests for Retrieve Audit Applications.
      Creat AuditTest abstract class for the dataprep, and validate if the audit is enabled.
2017-07-03 15:24:47 +03:00

37 lines
1.2 KiB
Java

package org.alfresco.rest.audit;
import static org.hamcrest.Matchers.is;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.core.RestResponse;
import org.alfresco.rest.core.RestWrapper;
import org.alfresco.rest.model.RestAuditAppModelsCollection;
import org.alfresco.utility.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.testng.annotations.BeforeClass;
import com.jayway.restassured.RestAssured;
public abstract class AuditTest extends RestTest
{
@Autowired
protected RestWrapper restAPI;
protected UserModel userModel;
protected RestAuditAppModelsCollection restAuditCollection;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
userModel = dataUser.createRandomTestUser();
RestAssured.basePath = "";
restAPI.configureRequestSpec().setBasePath(RestAssured.basePath);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "alfresco/service/api/audit/control");
RestResponse response = restAPI.authenticateUser(dataUser.getAdminUser()).process(request);
response.assertThat().body("enabled", is(true));
}
}