use of org.folio.rest.jaxrs.model.DeleteJobExecutionsResp in project mod-source-record-manager by folio-org.
the class JobExecutionDaoImpl method mapRowSetToDeleteChangeManagerJobExeResp.
private DeleteJobExecutionsResp mapRowSetToDeleteChangeManagerJobExeResp(RowSet<Row> rowSet) {
DeleteJobExecutionsResp deleteJobExecutionsResp = new DeleteJobExecutionsResp();
List<JobExecutionDetail> jobExecutionDetails = new ArrayList<>();
rowSet.forEach(row -> {
JobExecutionDetail executionLogDetail = new JobExecutionDetail();
executionLogDetail.setJobExecutionId(row.getUUID(ID).toString());
executionLogDetail.setIsDeleted(row.getBoolean(IS_DELETED));
jobExecutionDetails.add(executionLogDetail);
});
deleteJobExecutionsResp.setJobExecutionDetails(jobExecutionDetails);
return deleteJobExecutionsResp;
}
use of org.folio.rest.jaxrs.model.DeleteJobExecutionsResp in project mod-source-record-manager by folio-org.
the class ChangeManagerAPITest method shouldNotReturnAnyChildrenOfAnyParentOnGetChildrenByIdForDeletedLogs.
@Test
public void shouldNotReturnAnyChildrenOfAnyParentOnGetChildrenByIdForDeletedLogs() {
InitJobExecutionsRsDto response = constructAndPostInitJobExecutionRqDto(25);
List<JobExecution> createdJobExecutions = response.getJobExecutions();
assertThat(createdJobExecutions.size(), is(26));
JobExecution multipleParent = createdJobExecutions.stream().filter(jobExec -> jobExec.getSubordinationType().equals(JobExecution.SubordinationType.PARENT_MULTIPLE)).findFirst().get();
DeleteJobExecutionsResp deleteJobExecutionsResp = returnDeletedJobExecutionResponse(new String[] { multipleParent.getId() });
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getJobExecutionId(), is(multipleParent.getId()));
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getIsDeleted(), is(true));
RestAssured.given().spec(spec).when().get(JOB_EXECUTION_PATH + multipleParent.getId() + CHILDREN_PATH).then().statusCode(HttpStatus.SC_NOT_FOUND);
}
use of org.folio.rest.jaxrs.model.DeleteJobExecutionsResp in project mod-source-record-manager by folio-org.
the class ChangeManagerAPITest method testDeleteChangeManagerJobExecutionsDeletedIds.
@Test
public void testDeleteChangeManagerJobExecutionsDeletedIds() {
String parentJobExecutionId = constructAndPostInitJobExecutionRqDto(1).getParentJobExecutionId();
String parentJobExecutionId_2 = constructAndPostInitJobExecutionRqDto(1).getParentJobExecutionId();
DeleteJobExecutionsResp deleteJobExecutionsResp = returnDeletedJobExecutionResponse(new String[] { parentJobExecutionId });
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getJobExecutionId(), is(parentJobExecutionId));
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getIsDeleted(), is(true));
RestAssured.given().spec(spec).when().get(JOB_EXECUTION_PATH + parentJobExecutionId).then().statusCode(HttpStatus.SC_NOT_FOUND);
RestAssured.given().spec(spec).when().get(JOB_EXECUTION_PATH + parentJobExecutionId_2).then().statusCode(HttpStatus.SC_OK);
}
use of org.folio.rest.jaxrs.model.DeleteJobExecutionsResp in project mod-source-record-manager by folio-org.
the class MetadataProviderJobExecutionAPITest method shouldNotReturnDeletedJobExecutionRecords.
@Test
public void shouldNotReturnDeletedJobExecutionRecords(TestContext context) {
JobExecution createdJobExecution = constructAndPostInitJobExecutionRqDto(1).getJobExecutions().get(0);
putJobExecution(createdJobExecution);
DeleteJobExecutionsResp deleteJobExecutionsResp = ChangeManagerAPITest.returnDeletedJobExecutionResponse(new String[] { createdJobExecution.getId() });
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getJobExecutionId(), is(createdJobExecution.getId()));
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getIsDeleted(), is(true));
RestAssured.given().spec(spec).when().queryParam("hrid", createdJobExecution.getHrId()).get(GET_JOB_EXECUTIONS_PATH).then().statusCode(HttpStatus.SC_OK).body("jobExecutions", empty()).body("totalRecords", is(0));
}
use of org.folio.rest.jaxrs.model.DeleteJobExecutionsResp in project mod-source-record-manager by folio-org.
the class MetadataProviderJobExecutionAPITest method shouldReturnEmptyListWhenLogsAreMarkedForDeletion.
@Test
public void shouldReturnEmptyListWhenLogsAreMarkedForDeletion() {
InitJobExecutionsRsDto response = constructAndPostInitJobExecutionRqDto(1);
List<JobExecution> createdJobExecutions = response.getJobExecutions();
assertThat(createdJobExecutions.size(), is(1));
JobExecution jobExec = createdJobExecutions.get(0);
DeleteJobExecutionsResp deleteJobExecutionsResp = ChangeManagerAPITest.returnDeletedJobExecutionResponse(new String[] { jobExec.getId() });
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getJobExecutionId(), is(jobExec.getId()));
assertThat(deleteJobExecutionsResp.getJobExecutionDetails().get(0).getIsDeleted(), is(true));
RestAssured.given().spec(spec).when().get(GET_JOB_EXECUTION_JOURNAL_RECORDS_PATH + "/" + jobExec.getId()).then().statusCode(HttpStatus.SC_NOT_FOUND);
}
Aggregations