FINERACT-2028: Add audit logging for manual scheduler job execution
This commit is contained in:
+18
@@ -36,6 +36,7 @@ import java.util.List;
|
||||
import org.apache.fineract.integrationtests.common.AuditHelper;
|
||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -51,6 +52,7 @@ public class AuditIntegrationTest {
|
||||
private RequestSpecification requestSpec;
|
||||
private ClientHelper clientHelper;
|
||||
private AuditHelper auditHelper;
|
||||
private SchedulerJobHelper schedulerJobHelper;
|
||||
private static final SecureRandom rand = new SecureRandom();
|
||||
|
||||
/**
|
||||
@@ -65,6 +67,7 @@ public class AuditIntegrationTest {
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.auditHelper = new AuditHelper(this.requestSpec, this.responseSpec);
|
||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -157,4 +160,19 @@ public class AuditIntegrationTest {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void executeSchedulerJobShouldCreateAuditEntry() {
|
||||
// given
|
||||
int jobId = schedulerJobHelper.getSchedulerJobIdByShortName("SA_AANF");
|
||||
List<HashMap<String, Object>> auditsRecievedInitial = auditHelper.getAuditDetails(jobId, "EXECUTEJOB", "SCHEDULER");
|
||||
|
||||
// when
|
||||
schedulerJobHelper.runSchedulerJob(jobId);
|
||||
|
||||
// then
|
||||
List<HashMap<String, Object>> auditsRecieved = auditHelper.getAuditDetails(jobId, "EXECUTEJOB", "SCHEDULER");
|
||||
auditHelper.verifyMultipleAuditsOnserver(auditsRecievedInitial, auditsRecieved, jobId, "EXECUTEJOB", "SCHEDULER");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user