REPO-437: Audit REST API

Fix code formatting (tabs -> spaces, added/removed newlines were needed).
      Added description for updateAuditApp call.
This commit is contained in:
Alexandru-Eusebiu Epure
2017-07-24 11:46:02 +03:00
parent 4bab6d8282
commit ed05b6b4eb
2 changed files with 7 additions and 11 deletions
@@ -28,10 +28,10 @@ public abstract class AuditTest extends RestTest
@Autowired
protected RestWrapper restAPI;
@Autowired
protected JmxBuilder jmxBuilder;
protected UserModel userModel,adminUser;
protected RestAuditAppModelsCollection restAuditCollection;
protected RestAuditAppModel restAuditAppModel;
@@ -40,7 +40,6 @@ public abstract class AuditTest extends RestTest
protected RestAuditAppModel syncRestAuditAppModel;
protected RestAuditAppModel taggingRestAuditAppModel;
protected RestNodeModel node;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
@@ -49,7 +48,7 @@ public abstract class AuditTest extends RestTest
userModel = dataUser.createRandomTestUser();
adminUser = dataUser.getAdminUser();
//enable alfresco-access audit application
//Enable alfresco-access audit application.
jmxBuilder.getJmxClient().writeProperty("Alfresco:Type=Configuration,Category=Audit,id1=default", "audit.alfresco-access.enabled", Boolean.TRUE.toString());
String alfrescoAccessEnabled = jmxBuilder.getJmxClient().readProperty("Alfresco:Type=Configuration,Category=Audit,id1=default", "audit.alfresco-access.enabled").toString();
Assert.assertEquals(alfrescoAccessEnabled, Boolean.TRUE.toString(), String.format("Property audit.alfresco-access.enabled is [%s]", alfrescoAccessEnabled));
@@ -66,20 +65,19 @@ public abstract class AuditTest extends RestTest
restClient.assertStatusCodeIs(HttpStatus.OK);
restAuditCollection.assertThat().entriesListIsNotEmpty();
//Find alfresco-access audit application in the list of audit applications
//Find alfresco-access audit application in the list of audit applications.
int i = 0;
do
{
restAuditAppModel = restAuditCollection.getEntries().get(i++).onModel();
} while (!restAuditAppModel.getName().equals("alfresco-access"));
//Create new node
//Create new node.
RestNodeBodyModel nodeBody = new RestNodeBodyModel();
nodeBody.setName("MyFile");
nodeBody.setNodeType("cm:content");
node = restClient.withParams("autoRename=true").withCoreAPI().usingNode(ContentModel.my()).createNode(nodeBody);
node = restClient.withParams("autoRename=true").withCoreAPI().usingNode(ContentModel.my()).createNode(nodeBody);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
protected RestAuditAppModel getSyncRestAuditAppModel(UserModel userModel) throws Exception
@@ -1,6 +1,5 @@
package org.alfresco.rest.audit;
import static org.alfresco.utility.report.log.Step.STEP;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
@@ -248,7 +247,6 @@ public class GetAuditCoreTests extends AuditTest
{
assertEquals(id2, restAuditEntryCollection.getEntries().get(1).onModel().getId());
}
}
@Test(groups = { TestGroup.REST_API, TestGroup.AUDIT, TestGroup.CORE })
@@ -327,6 +325,6 @@ public class GetAuditCoreTests extends AuditTest
{
assertEquals(createdAt2, restAuditEntryCollection.getEntries().get(1).onModel().getCreatedAt());
}
}
}