diff --git a/NEWS.md b/NEWS.md index d43bee9ed..b00d2f096 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,3 @@ -## 2024-11-20 v3.9.2 -* [MODSOURMAN-1252](https://folio-org.atlassian.net/browse/MODSOURMAN-1252) Log details gives 404 error when try to open any completed job - -## 2024-11-18 v3.9.1 -* [MODSOURMAN-1248](https://folio-org.atlassian.net/browse/MODSOURMAN-1248) Missing interface dependencies in module descriptor - ## 2024-10-29 v3.9.0 * [MODSOURMAN-1232](https://folio-org.atlassian.net/browse/MODSOURMAN-1232) Add the option to exclude job profile names to GET "/metadata-provider/jobExecutions" endpoint * [MODSOURMAN-1195](https://folio-org.atlassian.net/browse/MODSOURMAN-1195) Save job execution progress in batches @@ -30,6 +24,7 @@ * [MODSOURMAN-1241](https://folio-org.atlassian.net/browse/MODSOURMAN-1241) Add missing module permissions for PUT /change-manager/parsedRecords/{id} * [MODSOURMAN-1222](https://folio-org.atlassian.net/browse/MODSOURMAN-1222) Fix inconsistencies in permission namings * [MODSOURMAN-1244](https://folio-org.atlassian.net/browse/MODSOURMAN-1244) Update MARC bib-instance default mapping to include additional subject types +* [MODSOURMAN-1240](https://folio-org.atlassian.net/browse/MODSOURMAN-1240) The title of record is not displayed on the JSON data after importing file for creating order ## 2023-03-22 v3.8.0 * [MODSOURMAN-1131](https://folio-org.atlassian.net/browse/MODSOURMAN-1131) The import of file for creating orders is completed with errors diff --git a/mod-source-record-manager-server/src/main/resources/templates/db_scripts/create_get_record_processing_log_function.sql b/mod-source-record-manager-server/src/main/resources/templates/db_scripts/create_get_record_processing_log_function.sql index deb30d6de..2c0fb109f 100644 --- a/mod-source-record-manager-server/src/main/resources/templates/db_scripts/create_get_record_processing_log_function.sql +++ b/mod-source-record-manager-server/src/main/resources/templates/db_scripts/create_get_record_processing_log_function.sql @@ -5,168 +5,227 @@ CREATE OR REPLACE FUNCTION get_record_processing_log(jobExecutionId uuid, record AS $$ BEGIN RETURN QUERY - WITH temp_result AS (SELECT id, journal_records.job_execution_id, journal_records.source_id, journal_records.entity_type, journal_records.entity_id, journal_records.entity_hrid, - CASE WHEN action_type = 'PARSE' - THEN 'PARSED' - WHEN error_max != '' OR action_type = 'NON_MATCH' - THEN 'DISCARDED' - WHEN action_type = 'CREATE' - THEN 'CREATED' - WHEN action_type = 'UPDATE' - THEN 'UPDATED' - END AS action_type, journal_records.action_status, journal_records.action_date, journal_records.source_record_order, journal_records.error, journal_records.title, journal_records.tenant_id, journal_records.instance_id, journal_records.holdings_id, journal_records.order_id, journal_records.permanent_location_id - FROM journal_records - INNER JOIN - (SELECT entity_type as entity_type_max, entity_id as entity_id_max,action_status as action_status_max, max(error) AS error_max,(array_agg(id ORDER BY array_position(array['CREATE', 'UPDATE', 'NON_MATCH'], action_type)))[1] AS id_max - FROM journal_records - WHERE journal_records.job_execution_id = jobExecutionId AND journal_records.source_id = recordId AND journal_records.entity_type NOT IN ('EDIFACT', 'INVOICE') AND action_type != 'MATCH' - GROUP BY entity_type,entity_id,action_status) AS action_type_by_source ON journal_records.id = action_type_by_source.id_max - UNION ALL - SELECT id, journal_records.job_execution_id, journal_records.source_id, journal_records.entity_type, journal_records.entity_id, journal_records.entity_hrid, - CASE WHEN error_max != '' OR action_type = 'MATCH' THEN 'DISCARDED' - END AS action_type, journal_records.action_status, journal_records.action_date, journal_records.source_record_order, journal_records.error, journal_records.title, journal_records.tenant_id, journal_records.instance_id, journal_records.holdings_id, journal_records.order_id, journal_records.permanent_location_id - FROM journal_records - INNER JOIN - (SELECT entity_type as entity_type_max, entity_id as entity_id_max,action_status as action_status_max, max(error) AS error_max,(array_agg(id ORDER BY array_position(array['NON_MATCH', 'MATCH'], action_type)))[1] AS id_max - FROM journal_records - WHERE journal_records.job_execution_id = jobExecutionId AND journal_records.source_id = recordId AND journal_records.entity_type NOT IN ('EDIFACT', 'INVOICE') AND action_type = 'MATCH' - AND NOT EXISTS (SELECT 1 FROM journal_records WHERE journal_records.job_execution_id = jobExecutionId AND journal_records.source_id = recordId AND action_type NOT IN ('MATCH', 'PARSE')) - GROUP BY entity_type,entity_id,action_status) AS action_type_by_source ON journal_records.id = action_type_by_source.id_max) - (SELECT - COALESCE(marc.job_execution_id,instances.job_execution_id,holdings.job_execution_id,items.job_execution_id) AS job_execution_id, - COALESCE(marc.source_id, instances.source_id, holdings.source_id, items.source_id, authority.source_id) as incoming_record_id, - marc_entity_id::uuid AS source_id, - COALESCE(marc.source_record_order,instances.source_record_order,holdings.source_record_order,items.source_record_order) AS source_record_order, - COALESCE(marc.title,instances.title,holdings.title,items.title) AS title, - marc.action_type AS source_record_action_status, - marc.error AS source_entity_error, - marc.tenant_id AS source_record_tenant_id, - - instances.action_type AS instance_action_status, - COALESCE(instances.entity_id,holdings.instance_id,items.instance_id) AS instance_entity_id, - instances.entity_hrid AS instance_entity_hrid, - instances.error AS instance_entity_error, - instances.tenant_id AS instance_entity_tenant_id, - - holdings.action_type AS holdings_action_status, - holdings.entity_hrid AS holdings_entity_hrid, - COALESCE(holdings.entity_id,items.holdings_id) AS holdings_entity_id, - holdings.permanent_location_id AS holdings_permanent_location_id, - holdings.error AS holdings_entity_error, - - items.action_type AS item_action_status, - items.entity_hrid AS item_entity_hrid, - items.entity_id AS item_entity_id, - items.error AS item_entity_error, - - authority.action_type AS authority_action_status, - authority.entity_id AS authority_entity_id, - authority.error AS authority_entity_error, - - po_lines.action_type AS po_line_action_status, - po_lines.entity_id AS po_line_entity_id, - po_lines.entity_hrid AS po_line_entity_hrid, - po_lines.error AS po_line_entity_error, - po_lines.order_id AS order_entity_id, + WITH temp_result AS ( + SELECT journal_records.id, + journal_records.job_execution_id, + journal_records.source_id, + journal_records.entity_type, + journal_records.entity_id, + journal_records.entity_hrid, + CASE + WHEN journal_records.action_type = 'PARSE' THEN 'PARSED' + WHEN action_type_by_source.error_max != '' OR journal_records.action_type = 'NON_MATCH' THEN 'DISCARDED' + WHEN journal_records.action_type = 'CREATE' THEN 'CREATED' + WHEN journal_records.action_type = 'UPDATE' THEN 'UPDATED' + END AS action_type, + journal_records.action_status, + journal_records.action_date, + journal_records.source_record_order, + journal_records.error, + action_type_by_source.title AS title, + journal_records.tenant_id, + journal_records.instance_id, + journal_records.holdings_id, + journal_records.order_id, + journal_records.permanent_location_id + FROM journal_records + INNER JOIN ( + SELECT entity_type as entity_type_max, + entity_id as entity_id_max, + action_status as action_status_max, + MAX(error) AS error_max, + (array_agg(id ORDER BY array_position(array['CREATE', 'UPDATE', 'NON_MATCH'], action_type)))[1] AS id_max, + MAX(journal_records.title) AS title + FROM journal_records + WHERE journal_records.job_execution_id = jobExecutionId + AND journal_records.source_id = recordId + AND journal_records.entity_type NOT IN ('EDIFACT', 'INVOICE') + AND action_type != 'MATCH' + GROUP BY entity_type, entity_id, action_status + ) AS action_type_by_source + ON journal_records.id = action_type_by_source.id_max + UNION ALL + SELECT journal_records.id, + journal_records.job_execution_id, + journal_records.source_id, + journal_records.entity_type, + journal_records.entity_id, + journal_records.entity_hrid, + CASE WHEN action_type_by_source.error_max != '' OR journal_records.action_type = 'MATCH' THEN 'DISCARDED' END AS action_type, + journal_records.action_status, + journal_records.action_date, + journal_records.source_record_order, + journal_records.error, + action_type_by_source.title AS title, + journal_records.tenant_id, + journal_records.instance_id, + journal_records.holdings_id, + journal_records.order_id, + journal_records.permanent_location_id + FROM journal_records + INNER JOIN ( + SELECT entity_type as entity_type_max, + entity_id as entity_id_max, + action_status as action_status_max, + MAX(error) AS error_max, + (array_agg(id ORDER BY array_position(array['NON_MATCH', 'MATCH'], action_type)))[1] AS id_max, + MAX(journal_records.title) AS title + FROM journal_records + WHERE journal_records.job_execution_id = jobExecutionId + AND journal_records.source_id = recordId + AND journal_records.entity_type NOT IN ('EDIFACT', 'INVOICE') + AND action_type = 'MATCH' + AND NOT EXISTS ( + SELECT 1 FROM journal_records + WHERE journal_records.job_execution_id = jobExecutionId + AND journal_records.source_id = recordId + AND action_type NOT IN ('MATCH', 'PARSE') + ) + GROUP BY entity_type, entity_id, action_status + ) AS action_type_by_source + ON journal_records.id = action_type_by_source.id_max + ) - null AS invoice_action_status, - null AS invoice_entity_id, - null AS invoice_entity_hrid, - null AS invoice_entity_error, - null AS invoice_line_action_status, - null AS invoice_line_entity_id, - null AS invoice_line_entity_hrid, - null AS invoice_line_entity_error - FROM (SELECT temp_result.source_id FROM temp_result WHERE action_type = 'PARSED') as parsed - LEFT JOIN - (SELECT temp_result.job_execution_id, entity_id, temp_result.title, temp_result.source_record_order, action_type, error, temp_result.source_id, temp_result.tenant_id - FROM temp_result WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND entity_id IS NOT NULL - UNION ALL - SELECT temp_result.job_execution_id, entity_id, temp_result.title, temp_result.source_record_order, action_type, error, temp_result.source_id, temp_result.tenant_id - FROM temp_result - WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND entity_id IS NULL AND NOT EXISTS - (SELECT 1 - FROM temp_result as tr2 - WHERE tr2.entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND tr2.source_id = temp_result.source_id and tr2.entity_id IS NOT NULL)) AS marc - ON marc.source_id = parsed.source_id - LEFT JOIN - (SELECT action_type, entity_id, temp_result.source_id, entity_hrid, error, temp_result.job_execution_id, temp_result.title, temp_result.source_record_order, temp_result.tenant_id - FROM temp_result WHERE entity_type = 'INSTANCE' AND entity_id IS NOT NULL - UNION ALL - SELECT action_type, entity_id, temp_result.source_id, entity_hrid, error, temp_result.job_execution_id, temp_result.title, temp_result.source_record_order, temp_result.tenant_id - FROM temp_result - WHERE entity_type = 'INSTANCE' AND entity_id IS NULL AND NOT EXISTS - (SELECT 1 - FROM temp_result as tr2 - WHERE tr2.entity_type = 'INSTANCE' AND tr2.source_id = temp_result.source_id and tr2.entity_id IS NOT NULL)) AS instances - ON marc.source_id = instances.source_id - LEFT JOIN - (SELECT action_type, entity_id, temp_result.source_id, error, temp_result.job_execution_id, temp_result.title, temp_result.source_record_order - FROM temp_result WHERE entity_type = 'AUTHORITY') AS authority - ON authority.source_id = marc.source_id - LEFT JOIN - (SELECT action_type,entity_id,entity_hrid,temp_result.source_id,error,order_id,temp_result.job_execution_id,temp_result.title,temp_result.source_record_order - FROM temp_result WHERE entity_type = 'PO_LINE') AS po_lines - ON po_lines.source_id = marc.source_id - FULL JOIN - (SELECT tmp.action_type, tmp.entity_type, tmp.entity_id, tmp.entity_hrid, tmp.error, tmp.instance_id, - tmp.permanent_location_id, tmp.job_execution_id, tmp.source_id, tmp.title, tmp.source_record_order - FROM temp_result tmp - INNER JOIN - (SELECT - CASE - WHEN EXISTS (SELECT condition_result.entity_id FROM temp_result condition_result - WHERE (condition_result.action_type='CREATED' AND condition_result.entity_type='HOLDINGS') - OR - (condition_result.action_type='DISCARDED' AND condition_result.error != '' AND condition_result.entity_type='HOLDINGS')) - THEN - (SELECT deep_nested.id - FROM temp_result deep_nested - WHERE - (deep_nested.action_type='CREATED' AND deep_nested.id = nested_result.id) - OR - (deep_nested.action_type='DISCARDED' AND deep_nested.error != '' AND deep_nested.id = nested_result.id)) - ELSE - nested_result.id - END - FROM temp_result nested_result) AS joining_table - ON tmp.id = joining_table.id - WHERE tmp.entity_type='HOLDINGS') - AS holdings - ON instances.entity_id = holdings.instance_id - FULL JOIN - (SELECT tmp.action_type, tmp.entity_id, tmp.holdings_id, tmp.entity_hrid, tmp.error, tmp.instance_id, - tmp.job_execution_id, tmp.source_id, tmp.title, tmp.source_record_order - FROM temp_result tmp - INNER JOIN - (SELECT - CASE - WHEN EXISTS (SELECT condition_result.entity_id FROM temp_result condition_result - WHERE (condition_result.action_type IN ('CREATED','UPDATED') AND condition_result.entity_type='ITEM') - OR - (condition_result.action_type='DISCARDED' AND condition_result.error != '' AND condition_result.entity_type='ITEM')) - THEN - (SELECT deep_nested.id - FROM temp_result deep_nested - WHERE - (deep_nested.action_type IN ('CREATED','UPDATED') AND deep_nested.id = nested_result.id) - OR - (deep_nested.action_type='DISCARDED' AND deep_nested.error != '' AND deep_nested.id = nested_result.id)) - ELSE - nested_result.id - END - FROM temp_result nested_result) AS joining_table - ON tmp.id = joining_table.id - WHERE tmp.entity_type='ITEM') AS items - ON holdings.entity_id = items.holdings_id - LEFT JOIN ( - SELECT entity_id AS marc_entity_id, temp_result.source_id AS marc_source_id - FROM temp_result WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY') AND entity_id IS NOT NULL - ) AS marc_identifiers ON marc.source_id = marc_identifiers.marc_source_id - ORDER BY holdings.entity_hrid) + ( + SELECT + COALESCE(marc.job_execution_id,instances.job_execution_id,holdings.job_execution_id,items.job_execution_id) AS job_execution_id, + COALESCE(marc.source_id, instances.source_id, holdings.source_id, items.source_id, authority.source_id) as incoming_record_id, + marc_entity_id::uuid AS source_id, + COALESCE(marc.source_record_order,instances.source_record_order,holdings.source_record_order,items.source_record_order) AS source_record_order, + COALESCE(marc.title,instances.title,holdings.title,items.title,po_lines.title) AS title, + marc.action_type AS source_record_action_status, + marc.error AS source_entity_error, + marc.tenant_id AS source_record_tenant_id, + instances.action_type AS instance_action_status, + COALESCE(instances.entity_id,holdings.instance_id,items.instance_id) AS instance_entity_id, + instances.entity_hrid AS instance_entity_hrid, + instances.error AS instance_entity_error, + instances.tenant_id AS instance_entity_tenant_id, + holdings.action_type AS holdings_action_status, + holdings.entity_hrid AS holdings_entity_hrid, + COALESCE(holdings.entity_id,items.holdings_id) AS holdings_entity_id, + holdings.permanent_location_id AS holdings_permanent_location_id, + holdings.error AS holdings_entity_error, + items.action_type AS item_action_status, + items.entity_hrid AS item_entity_hrid, + items.entity_id AS item_entity_id, + items.error AS item_entity_error, + authority.action_type AS authority_action_status, + authority.entity_id AS authority_entity_id, + authority.error AS authority_entity_error, + po_lines.action_type AS po_line_action_status, + po_lines.entity_id AS po_line_entity_id, + po_lines.entity_hrid AS po_line_entity_hrid, + po_lines.error AS po_line_entity_error, + po_lines.order_id AS order_entity_id, + null AS invoice_action_status, + null AS invoice_entity_id, + null AS invoice_entity_hrid, + null AS invoice_entity_error, + null AS invoice_line_action_status, + null AS invoice_line_entity_id, + null AS invoice_line_entity_hrid, + null AS invoice_line_entity_error + FROM (SELECT temp_result.source_id FROM temp_result WHERE action_type = 'PARSED') as parsed + LEFT JOIN + (SELECT temp_result.job_execution_id, entity_id, temp_result.title, temp_result.source_record_order, action_type, error, temp_result.source_id, temp_result.tenant_id + FROM temp_result WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND entity_id IS NOT NULL + UNION ALL + SELECT temp_result.job_execution_id, entity_id, temp_result.title, temp_result.source_record_order, action_type, error, temp_result.source_id, temp_result.tenant_id + FROM temp_result + WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND entity_id IS NULL AND NOT EXISTS + (SELECT 1 + FROM temp_result as tr2 + WHERE tr2.entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY', 'PO_LINE') AND tr2.source_id = temp_result.source_id and tr2.entity_id IS NOT NULL + ) + ) AS marc + ON marc.source_id = parsed.source_id + LEFT JOIN + ( + SELECT action_type, entity_id, temp_result.source_id, entity_hrid, error, temp_result.job_execution_id, temp_result.title as title, temp_result.source_record_order, temp_result.tenant_id + FROM temp_result WHERE entity_type = 'INSTANCE' AND entity_id IS NOT NULL + UNION ALL + SELECT action_type, entity_id, temp_result.source_id, entity_hrid, error, temp_result.job_execution_id, temp_result.title as title, temp_result.source_record_order, temp_result.tenant_id + FROM temp_result WHERE entity_type = 'INSTANCE' AND entity_id IS NULL AND NOT EXISTS + ( + SELECT 1 + FROM temp_result as tr2 + WHERE tr2.entity_type = 'INSTANCE' AND tr2.source_id = temp_result.source_id and tr2.entity_id IS NOT NULL + ) + ) AS instances + ON marc.source_id = instances.source_id + LEFT JOIN + ( + SELECT action_type, entity_id, temp_result.source_id, error, temp_result.job_execution_id, temp_result.title as title, temp_result.source_record_order + FROM temp_result WHERE entity_type = 'AUTHORITY' + ) AS authority + ON authority.source_id = marc.source_id + LEFT JOIN + ( + SELECT action_type, entity_id, entity_hrid, temp_result.source_id, error,order_id, temp_result.job_execution_id, temp_result.title as title, temp_result.source_record_order + FROM temp_result WHERE entity_type = 'PO_LINE' + ) AS po_lines + ON po_lines.source_id = marc.source_id + FULL JOIN + (SELECT tmp.action_type, tmp.entity_type, tmp.entity_id, tmp.entity_hrid, tmp.error, tmp.instance_id, + tmp.permanent_location_id, tmp.job_execution_id, tmp.source_id, tmp.title, tmp.source_record_order + FROM temp_result tmp + INNER JOIN + (SELECT + CASE + WHEN EXISTS (SELECT condition_result.entity_id FROM temp_result condition_result + WHERE (condition_result.action_type='CREATED' AND condition_result.entity_type='HOLDINGS') + OR + (condition_result.action_type='DISCARDED' AND condition_result.error != '' AND condition_result.entity_type='HOLDINGS')) + THEN + (SELECT deep_nested.id + FROM temp_result deep_nested + WHERE + (deep_nested.action_type='CREATED' AND deep_nested.id = nested_result.id) + OR + (deep_nested.action_type='DISCARDED' AND deep_nested.error != '' AND deep_nested.id = nested_result.id)) + ELSE + nested_result.id + END + FROM temp_result nested_result) AS joining_table + ON tmp.id = joining_table.id + WHERE tmp.entity_type='HOLDINGS') AS holdings + ON instances.entity_id = holdings.instance_id + FULL JOIN + (SELECT tmp.action_type, tmp.entity_id, tmp.holdings_id, tmp.entity_hrid, tmp.error, tmp.instance_id, + tmp.job_execution_id, tmp.source_id, tmp.title, tmp.source_record_order + FROM temp_result tmp + INNER JOIN + (SELECT + CASE + WHEN EXISTS (SELECT condition_result.entity_id FROM temp_result condition_result + WHERE (condition_result.action_type IN ('CREATED','UPDATED') AND condition_result.entity_type='ITEM') + OR + (condition_result.action_type='DISCARDED' AND condition_result.error != '' AND condition_result.entity_type='ITEM')) + THEN + (SELECT deep_nested.id + FROM temp_result deep_nested + WHERE + (deep_nested.action_type IN ('CREATED','UPDATED') AND deep_nested.id = nested_result.id) + OR + (deep_nested.action_type='DISCARDED' AND deep_nested.error != '' AND deep_nested.id = nested_result.id)) + ELSE + nested_result.id + END + FROM temp_result nested_result) AS joining_table + ON tmp.id = joining_table.id + WHERE tmp.entity_type='ITEM') AS items + ON holdings.entity_id = items.holdings_id + LEFT JOIN ( + SELECT entity_id AS marc_entity_id, temp_result.source_id AS marc_source_id + FROM temp_result WHERE entity_type IN ('MARC_BIBLIOGRAPHIC', 'MARC_HOLDINGS', 'MARC_AUTHORITY') AND entity_id IS NOT NULL + ) AS marc_identifiers + ON marc.source_id = marc_identifiers.marc_source_id + ORDER BY holdings.entity_hrid + ) UNION SELECT invoice_line_info.job_execution_id, - records_actions.source_id as incoming_record_id, + records_actions.source_id as incoming_record_id, records_actions.source_id as source_id, records_actions.source_record_order, invoice_line_info.title, diff --git a/mod-source-record-manager-server/src/test/java/org/folio/rest/impl/metadataProvider/MetaDataProviderJobLogEntriesAPITest.java b/mod-source-record-manager-server/src/test/java/org/folio/rest/impl/metadataProvider/MetaDataProviderJobLogEntriesAPITest.java index 3913528b2..8f243d181 100644 --- a/mod-source-record-manager-server/src/test/java/org/folio/rest/impl/metadataProvider/MetaDataProviderJobLogEntriesAPITest.java +++ b/mod-source-record-manager-server/src/test/java/org/folio/rest/impl/metadataProvider/MetaDataProviderJobLogEntriesAPITest.java @@ -141,6 +141,35 @@ public void shouldReturnPoLineWithOrderIdWhenMarcCreate(TestContext context) { })); } + @Test + public void shouldReturnPoLineRecordWithTitleWhenOrderImported(TestContext context) { + Async async = context.async(); + JobExecution createdJobExecution = constructAndPostInitJobExecutionRqDto(1).getJobExecutions().get(0); + String sourceRecordId = UUID.randomUUID().toString(); + String recordTitle = "test title"; + + Future future = Future.succeededFuture() + .compose(v -> createJournalRecord(createdJobExecution.getId(), sourceRecordId, null, null, null, 0, PARSE, null, COMPLETED, null, null)) + .compose(v -> createJournalRecord(createdJobExecution.getId(), sourceRecordId, "poLineEntityID", null, recordTitle, 0, CREATE, PO_LINE, COMPLETED, null, null)) + .onFailure(context::fail); + + future.onComplete(ar -> context.verify(v -> { + RestAssured.given() + .spec(spec) + .when() + .get(GET_JOB_EXECUTION_JOURNAL_RECORDS_PATH + "/" + createdJobExecution.getId() + "/records/" + sourceRecordId) + .then() + .statusCode(HttpStatus.SC_OK) + .body("jobExecutionId", is(createdJobExecution.getId())) + .body("incomingRecordId", is(sourceRecordId)) + .body("sourceRecordTitle", is(recordTitle)) + .body("sourceRecordActionStatus", is(ActionStatus.CREATED.value())); + + async.complete(); + })); + } + + @Test public void shouldReturnOneInstanceIdWhenMarcBibUpdatedAndInstanceUpdated(TestContext context) { Async async = context.async(); diff --git a/ramls/raml-storage b/ramls/raml-storage index 8f35e1fa5..ac1fd05b9 160000 --- a/ramls/raml-storage +++ b/ramls/raml-storage @@ -1 +1 @@ -Subproject commit 8f35e1fa5902bab4792a2b4a5511e9eb2a860aef +Subproject commit ac1fd05b9ff5fd1b653c8e12a7d01254d2b4de1c