From 025e76d4b09f262268bb44e21f96f4de3e2955d0 Mon Sep 17 00:00:00 2001 From: Andrei Bordak Date: Wed, 27 Nov 2024 20:32:49 +0400 Subject: [PATCH 1/4] MODLD-601: LCCN deduplication MODLD-601: LCCN deduplication test --- .../features/util/crud-settings.feature | 19 +++++++++ .../features/util/validation-resource.feature | 11 +++++ .../deduplication/lccn-deduplication.feature | 42 +++++++++++++++++++ .../samples/instance-request.json | 42 +++++++++++++++++++ .../deduplication/samples/work-request.json | 34 +++++++++++++++ .../mod-linked-data/linked-data-junit.feature | 4 ++ .../src/main/resources/karate-config.js | 3 ++ .../java/org/folio/ModLinkedDataTest.java | 5 +++ 8 files changed, 160 insertions(+) create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/instance-request.json create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/work-request.json diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature new file mode 100644 index 000000000..eb324d27c --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature @@ -0,0 +1,19 @@ +Feature: CRUD operations on settings + Background: + * url baseUrl + + @getSettings + Scenario: Get settings + Given path 'settings/entries' + And param query = query + When method GET + Then status 200 + * def response = $ + + @putSetting + Scenario: Put a setting + Given path 'settings/entries/' + id + And request settingRequest + When method PUT + Then status 200 + * def response = $ diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature new file mode 100644 index 000000000..8efcd3352 --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature @@ -0,0 +1,11 @@ +Feature: Resource validation + Background: + * url baseUrl + + @validationErrorWithCodeOnResourceCreation + Scenario: Get a resource + Given path 'linked-data/resource' + And request resource + When method POST + Then status 400 + And match $.errors[0].code == code diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature new file mode 100644 index 000000000..2e9e27941 --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature @@ -0,0 +1,42 @@ +Feature: LCCN validation for duplicates. + + Background: + * url baseUrl + * call login testUser + * def testUserHeaders = { 'Content-Type': 'application/json', 'x-okapi-token': '#(okapitoken)', 'Accept': '*/*' } + * configure headers = testUserHeaders + + Scenario: Create a new resource in Linked Data, enable LCCN deduplication and try to create a resource with same LCCN. + # Step 1: Enable LCCN deduplication + * def settingsResponse = call getSettings { query: '(scope==ui-quick-marc.lccn-duplicate-check.manage and key==lccn-duplicate-check)'} + * def setting = postInstanceCall.response.items[0] + * karate.log('##setting##', setting) + * eval setting.value.duplicateLccnCheckingEnabled = true + * call putSetting { id : '#(setting.id)', settingRequest : '#(setting)'} + + # Step 2: Create work and instance + * def workRequest = read('samples/work-request.json') + * def workResponse = call postResource { resourceRequest: '#(workRequest)' } + * def workId = workResponse.response.resource['http://bibfra.me/vocab/lite/Work'].id + + * def instanceRequest = read('samples/instance-request.json') + * def instanceResponse = call postResource { resourceRequest: '#(instanceRequest)' } + + # Step 3: Update the instance with same LCCN (here we check linked-data -> mod-search interaction and id exclusion) + * def instanceId = instanceResponse.response.resource['http://bibfra.me/vocab/lite/Instance'].id + * call putResource { id: '#(instanceId)' , resourceRequest: '#(instanceRequest)' } + + # Step 4: Create new instance with existing LCCN, verify bad request + * eval workRequest.resource['http://bibfra.me/vocab/lite/Work']['http://bibfra.me/vocab/marc/title'][0]['http://bibfra.me/vocab/marc/Title']['http://bibfra.me/vocab/marc/mainTitle'] = ['new_title'] + * def newWorkResponse = call postResource { resourceRequest: '#(workRequest)' } + * eval workId = newWorkResponse.response.resource['http://bibfra.me/vocab/lite/Work'].id + * def newInstanceRequest = read('samples/instance-request.json') + * eval newInstanceRequest.resource['http://bibfra.me/vocab/lite/Instance']['http://bibfra.me/vocab/marc/title'][0]['http://bibfra.me/vocab/marc/Title']['http://bibfra.me/vocab/marc/mainTitle'] = ['new_title'] + * call validationErrorWithCodeOnResourceCreation { resource: '#(newInstanceRequest)', code: 'lccn_not_unique'} + + # Step 5: Disable LCCN deduplication setting + * eval setting.value.duplicateLccnCheckingEnabled = false + * call putSetting { id : '#(setting.id)', settingRequest : '#(setting)'} + + # Step 6: Create new instance with existing LCCN, verify success + * call postResource { resourceRequest: '#(newInstanceRequest)' } \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/instance-request.json b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/instance-request.json new file mode 100644 index 000000000..0836bf78e --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/instance-request.json @@ -0,0 +1,42 @@ +{ + "resource":{ + "http://bibfra.me/vocab/lite/Instance":{ + "http://bibfra.me/vocab/marc/title":[ + { + "http://bibfra.me/vocab/marc/Title":{ + "http://bibfra.me/vocab/bflc/nonSortNum":[ + "1" + ], + "http://bibfra.me/vocab/marc/mainTitle":[ + "deduplication_main_title" + ] + } + } + ], + "http://library.link/vocab/map":[ + { + "http://library.link/identifier/LCCN":{ + "http://bibfra.me/vocab/lite/name":[ + "nn0987654321" + ], + "http://bibfra.me/vocab/marc/status":[ + { + "http://bibfra.me/vocab/lite/label":[ + "current" + ], + "http://bibfra.me/vocab/lite/link":[ + "http://id.loc.gov/vocabulary/mstatus/current" + ] + } + ] + } + } + ], + "_workReference":[ + { + "id":"#(workId)" + } + ] + } + } +} \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/work-request.json b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/work-request.json new file mode 100644 index 000000000..d43ed670b --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/work-request.json @@ -0,0 +1,34 @@ +{ + "resource":{ + "http://bibfra.me/vocab/lite/Work":{ + "http://bibfra.me/vocab/marc/title":[ + { + "http://bibfra.me/vocab/marc/Title":{ + "http://bibfra.me/vocab/bflc/nonSortNum":[ + "1" + ], + "http://bibfra.me/vocab/marc/mainTitle":[ + "deduplication_main_title" + ], + "http://bibfra.me/vocab/marc/partNumber":[ + "1" + ], + "http://bibfra.me/vocab/marc/partName":[ + "part 1" + ] + } + } + ], + "http://bibfra.me/vocab/marc/content":[ + { + "http://bibfra.me/vocab/marc/term":[ + "cartographic image" + ], + "http://bibfra.me/vocab/lite/link":[ + "http://id.loc.gov/vocabulary/contentTypes/cri" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature index 43b44bf92..7aa92c1cc 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature @@ -55,6 +55,10 @@ Feature: mod-linked-data integration tests | 'specification-storage.specifications.collection.get' | | 'specification-storage.specification.rules.collection.get' | | 'specification-storage.specification.rules.item.patch' | + | 'ui-quick-marc.settings.lccn-duplicate-check.edit' | + | 'mod-settings.entries.collection.get' | + | 'mod-settings.entries.item.get' | + | 'mod-settings.entries.item.put' | Scenario: create tenant and users for testing Given call read('classpath:common/setup-users.feature') diff --git a/mod-linked-data/src/main/resources/karate-config.js b/mod-linked-data/src/main/resources/karate-config.js index cf754042b..455dacb74 100644 --- a/mod-linked-data/src/main/resources/karate-config.js +++ b/mod-linked-data/src/main/resources/karate-config.js @@ -38,6 +38,9 @@ function fn() { getResourceGraph: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@getResourceGraph'), getResourceSupportCheck: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@getResourceSupportCheck'), getResourcePreview: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@getResourcePreview'), + validationErrorWithCodeOnResourceCreation: karate.read('classpath:citation/mod-linked-data/features/util/validation-resource.feature@validationErrorWithCodeOnResourceCreation'), + getSettings: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSettings'), + getSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSetting'), postImport: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@postImport'), getSpecifications: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getSpecifications'), getRules: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getRules'), diff --git a/mod-linked-data/src/test/java/org/folio/ModLinkedDataTest.java b/mod-linked-data/src/test/java/org/folio/ModLinkedDataTest.java index 7a8434510..f3ad592ee 100644 --- a/mod-linked-data/src/test/java/org/folio/ModLinkedDataTest.java +++ b/mod-linked-data/src/test/java/org/folio/ModLinkedDataTest.java @@ -61,4 +61,9 @@ void importBibRecordFromSrsToLinkedData() { void lccnPatternValidation() { runFeatureTest("lccn-pattern-validation/lccn-pattern-validation.feature"); } + + @Test + void lccnDeduplication() { + runFeatureTest("validation/lccn/deduplication/lccn-deduplication.feature"); + } } From f198ad93d5dd83322ffca9244d654af451ee71aa Mon Sep 17 00:00:00 2001 From: Andrei Bordak Date: Fri, 29 Nov 2024 13:49:41 +0400 Subject: [PATCH 2/4] MODLD-601: Review fixes --- .../mod-linked-data/features/util/validation-resource.feature | 2 +- .../citation/mod-linked-data/linked-data-junit.feature | 1 + mod-linked-data/src/main/resources/karate-config.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature index 8efcd3352..2fff0de0a 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/validation-resource.feature @@ -3,7 +3,7 @@ Feature: Resource validation * url baseUrl @validationErrorWithCodeOnResourceCreation - Scenario: Get a resource + Scenario: Post a resource and verify bad request Given path 'linked-data/resource' And request resource When method POST diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature index 7aa92c1cc..551b7ac4e 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature @@ -15,6 +15,7 @@ Feature: mod-linked-data integration tests | 'mod-quick-marc' | | 'mod-linked-data' | | 'mod-record-specifications' | + | 'mod-settings' | * table userPermissions | name | diff --git a/mod-linked-data/src/main/resources/karate-config.js b/mod-linked-data/src/main/resources/karate-config.js index 455dacb74..976cb1f6a 100644 --- a/mod-linked-data/src/main/resources/karate-config.js +++ b/mod-linked-data/src/main/resources/karate-config.js @@ -40,7 +40,7 @@ function fn() { getResourcePreview: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@getResourcePreview'), validationErrorWithCodeOnResourceCreation: karate.read('classpath:citation/mod-linked-data/features/util/validation-resource.feature@validationErrorWithCodeOnResourceCreation'), getSettings: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSettings'), - getSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSetting'), + putSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@putSetting'), postImport: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@postImport'), getSpecifications: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getSpecifications'), getRules: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getRules'), From 23391a76e34b31c69e1702bf9bf3b2c9f427f7b8 Mon Sep 17 00:00:00 2001 From: Andrei Bordak Date: Thu, 5 Dec 2024 20:56:13 +0400 Subject: [PATCH 3/4] MODLD-601: Review fixes --- .../features/util/crud-settings.feature | 14 +++++++ .../deduplication/lccn-deduplication.feature | 23 +++++----- .../samples/invalid-instance-request.json | 42 +++++++++++++++++++ .../samples/setting-request.json | 8 ++++ .../mod-linked-data/linked-data-junit.feature | 1 + .../src/main/resources/karate-config.js | 2 + 6 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/invalid-instance-request.json create mode 100644 mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/setting-request.json diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature index eb324d27c..a1114ce40 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/util/crud-settings.feature @@ -17,3 +17,17 @@ Feature: CRUD operations on settings When method PUT Then status 200 * def response = $ + + @postSetting + Scenario: Post a setting + Given path 'settings/entries/' + And request settingRequest + When method POST + Then status 204 + + @getSetting + Scenario: Get a setting + Given path 'settings/entries/' + id + When method GET + Then status 200 + * def response = $ diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature index 2e9e27941..0b123511f 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature @@ -8,11 +8,12 @@ Feature: LCCN validation for duplicates. Scenario: Create a new resource in Linked Data, enable LCCN deduplication and try to create a resource with same LCCN. # Step 1: Enable LCCN deduplication - * def settingsResponse = call getSettings { query: '(scope==ui-quick-marc.lccn-duplicate-check.manage and key==lccn-duplicate-check)'} - * def setting = postInstanceCall.response.items[0] + * def settingRequest = read('samples/setting-request.json') + * def settingsResponse = call postSetting + * def setting = call getSetting { id: '#(settingRequest.id)'} * karate.log('##setting##', setting) - * eval setting.value.duplicateLccnCheckingEnabled = true - * call putSetting { id : '#(setting.id)', settingRequest : '#(setting)'} + * def settingsResponse = call getSettings { query: '(scope==ui-quick-marc.lccn-duplicate-check.manage and key==lccn-duplicate-check)'} + * karate.log('##settings##', settingsResponse) # Step 2: Create work and instance * def workRequest = read('samples/work-request.json') @@ -27,16 +28,12 @@ Feature: LCCN validation for duplicates. * call putResource { id: '#(instanceId)' , resourceRequest: '#(instanceRequest)' } # Step 4: Create new instance with existing LCCN, verify bad request - * eval workRequest.resource['http://bibfra.me/vocab/lite/Work']['http://bibfra.me/vocab/marc/title'][0]['http://bibfra.me/vocab/marc/Title']['http://bibfra.me/vocab/marc/mainTitle'] = ['new_title'] - * def newWorkResponse = call postResource { resourceRequest: '#(workRequest)' } - * eval workId = newWorkResponse.response.resource['http://bibfra.me/vocab/lite/Work'].id - * def newInstanceRequest = read('samples/instance-request.json') - * eval newInstanceRequest.resource['http://bibfra.me/vocab/lite/Instance']['http://bibfra.me/vocab/marc/title'][0]['http://bibfra.me/vocab/marc/Title']['http://bibfra.me/vocab/marc/mainTitle'] = ['new_title'] - * call validationErrorWithCodeOnResourceCreation { resource: '#(newInstanceRequest)', code: 'lccn_not_unique'} + * def invalidInstanceRequest = read('samples/invalid-instance-request.json') + * call validationErrorWithCodeOnResourceCreation { resource: '#(invalidInstanceRequest)', code: 'lccn_not_unique'} # Step 5: Disable LCCN deduplication setting - * eval setting.value.duplicateLccnCheckingEnabled = false - * call putSetting { id : '#(setting.id)', settingRequest : '#(setting)'} + * eval settingRequest.value.duplicateLccnCheckingEnabled = false + * call putSetting { id : '#(settingRequest.id)', settingRequest : '#(settingRequest)'} # Step 6: Create new instance with existing LCCN, verify success - * call postResource { resourceRequest: '#(newInstanceRequest)' } \ No newline at end of file + * call postResource { resourceRequest: '#(invalidInstanceRequest)' } \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/invalid-instance-request.json b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/invalid-instance-request.json new file mode 100644 index 000000000..64c8934dd --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/invalid-instance-request.json @@ -0,0 +1,42 @@ +{ + "resource":{ + "http://bibfra.me/vocab/lite/Instance":{ + "http://bibfra.me/vocab/marc/title":[ + { + "http://bibfra.me/vocab/marc/Title":{ + "http://bibfra.me/vocab/bflc/nonSortNum":[ + "1" + ], + "http://bibfra.me/vocab/marc/mainTitle":[ + "main_title" + ] + } + } + ], + "http://library.link/vocab/map":[ + { + "http://library.link/identifier/LCCN":{ + "http://bibfra.me/vocab/lite/name":[ + "nn0987654321" + ], + "http://bibfra.me/vocab/marc/status":[ + { + "http://bibfra.me/vocab/lite/label":[ + "current" + ], + "http://bibfra.me/vocab/lite/link":[ + "http://id.loc.gov/vocabulary/mstatus/current" + ] + } + ] + } + } + ], + "_workReference":[ + { + "id":"#(workId)" + } + ] + } + } +} \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/setting-request.json b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/setting-request.json new file mode 100644 index 000000000..813f02330 --- /dev/null +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/samples/setting-request.json @@ -0,0 +1,8 @@ +{ + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f45", + "scope": "ui-quick-marc.lccn-duplicate-check.manage", + "key": "lccn-duplicate-check", + "value": { + "duplicateLccnCheckingEnabled": true + } +} \ No newline at end of file diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature index 551b7ac4e..57c3d434e 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/linked-data-junit.feature @@ -16,6 +16,7 @@ Feature: mod-linked-data integration tests | 'mod-linked-data' | | 'mod-record-specifications' | | 'mod-settings' | + | 'folio_quick-marc' | * table userPermissions | name | diff --git a/mod-linked-data/src/main/resources/karate-config.js b/mod-linked-data/src/main/resources/karate-config.js index 976cb1f6a..0a7d7a010 100644 --- a/mod-linked-data/src/main/resources/karate-config.js +++ b/mod-linked-data/src/main/resources/karate-config.js @@ -41,6 +41,8 @@ function fn() { validationErrorWithCodeOnResourceCreation: karate.read('classpath:citation/mod-linked-data/features/util/validation-resource.feature@validationErrorWithCodeOnResourceCreation'), getSettings: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSettings'), putSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@putSetting'), + postSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@postSetting'), + getSetting: karate.read('classpath:citation/mod-linked-data/features/util/crud-settings.feature@getSetting'), postImport: karate.read('classpath:citation/mod-linked-data/features/util/crud-resource.feature@postImport'), getSpecifications: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getSpecifications'), getRules: karate.read('classpath:citation/mod-linked-data/features/util/crud-specifications.feature@getRules'), From 40c6f5b7dc8921b8d5172090ac454e9f717cfb3e Mon Sep 17 00:00:00 2001 From: Andrei Bordak Date: Thu, 5 Dec 2024 21:30:51 +0400 Subject: [PATCH 4/4] MODLD-601: Temp debug step --- .../lccn/deduplication/lccn-deduplication.feature | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature index 0b123511f..309993ac1 100644 --- a/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature +++ b/mod-linked-data/src/main/resources/citation/mod-linked-data/features/validation/lccn/deduplication/lccn-deduplication.feature @@ -27,6 +27,16 @@ Feature: LCCN validation for duplicates. * def instanceId = instanceResponse.response.resource['http://bibfra.me/vocab/lite/Instance'].id * call putResource { id: '#(instanceId)' , resourceRequest: '#(instanceRequest)' } + # Temp debug step, checking instance with LCCN exists in search + Given path 'search/instances' + And param query = '(lccn=nn0987654321)' + And param limit = 10 + And param offset = 0 + When method GET + Then status 200 + * def inventoryInstanceSearchResponse = $ + * karate.log('##inventoryInstanceSearchResponse##', inventoryInstanceSearchResponse) + # Step 4: Create new instance with existing LCCN, verify bad request * def invalidInstanceRequest = read('samples/invalid-instance-request.json') * call validationErrorWithCodeOnResourceCreation { resource: '#(invalidInstanceRequest)', code: 'lccn_not_unique'}