use of org.folio.rest.jaxrs.model.JournalRecord.EntityType.AUTHORITY in project mod-source-record-manager by folio-org.
the class MetaDataProviderJobLogEntriesAPITest method shouldReturnAuthorityCreated.
@Test
public void shouldReturnAuthorityCreated(TestContext context) {
Async async = context.async();
JobExecution createdJobExecution = constructAndPostInitJobExecutionRqDto(1).getJobExecutions().get(0);
String sourceRecordId = UUID.randomUUID().toString();
String recordTitle = "test title";
Future<JournalRecord> future = Future.succeededFuture().compose(v -> createJournalRecord(createdJobExecution.getId(), sourceRecordId, null, null, recordTitle, 0, CREATE, MARC_AUTHORITY, COMPLETED, null)).compose(v -> createJournalRecord(createdJobExecution.getId(), sourceRecordId, null, null, null, 0, CREATE, AUTHORITY, COMPLETED, null)).onFailure(context::fail);
future.onComplete(ar -> context.verify(v -> {
RestAssured.given().spec(spec).when().get(GET_JOB_EXECUTION_JOURNAL_RECORDS_PATH + "/" + createdJobExecution.getId()).then().statusCode(HttpStatus.SC_OK).body("entries.size()", is(1)).body("totalRecords", is(1)).body("entries[0].sourceRecordId", is(sourceRecordId)).body("entries[0].sourceRecordTitle", is(recordTitle)).body("entries[0].sourceRecordActionStatus", is(ActionStatus.CREATED.value())).body("entries[0].authorityActionStatus", is(ActionStatus.CREATED.value()));
async.complete();
}));
}
use of org.folio.rest.jaxrs.model.JournalRecord.EntityType.AUTHORITY in project mod-source-record-manager by folio-org.
the class MetadataProviderJobExecutionAPITest method shouldReturnAuthoritySummaryWhenAuthorityWasCreated.
@Test
public void shouldReturnAuthoritySummaryWhenAuthorityWasCreated(TestContext context) {
Async async = context.async();
String jobExecutionId = constructAndPostInitJobExecutionRqDto(1).getJobExecutions().get(0).getId();
String sourceRecordId = UUID.randomUUID().toString();
Future<JournalRecord> future = Future.succeededFuture().compose(v -> createJournalRecord(jobExecutionId, sourceRecordId, null, null, null, 0, CREATE, MARC_AUTHORITY, COMPLETED, null)).compose(v -> createJournalRecord(jobExecutionId, sourceRecordId, null, null, null, 0, CREATE, AUTHORITY, COMPLETED, null)).onFailure(context::fail);
future.onComplete(ar -> context.verify(v -> {
RestAssured.given().spec(spec).when().get(GET_JOB_EXECUTION_SUMMARY_PATH + "/" + jobExecutionId).then().statusCode(HttpStatus.SC_OK).body("jobExecutionId", is(jobExecutionId)).body("sourceRecordSummary.totalCreatedEntities", is(1)).body("sourceRecordSummary.totalUpdatedEntities", is(0)).body("sourceRecordSummary.totalDiscardedEntities", is(0)).body("sourceRecordSummary.totalErrors", is(0)).body("authoritySummary.totalCreatedEntities", is(1)).body("authoritySummary.totalUpdatedEntities", is(0)).body("authoritySummary.totalDiscardedEntities", is(0)).body("authoritySummary.totalErrors", is(0)).body("totalErrors", is(0));
async.complete();
}));
}
Aggregations