From 6e75840b503238bef9f87a5089913f77c8b48e6f Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Wed, 20 Nov 2024 14:01:56 +0200 Subject: [PATCH 01/15] PR-2049 Use call number from accept item call when exists --- .../java/org/folio/ncip/FolioRemoteServiceManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index b241366..f7cd202 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -497,6 +497,11 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S throw new FolioNcipException(Constants.REQUEST_ID_MISSING); } + String callNumber = null; + if (initData.getItemOptionalFields() != null && initData.getItemOptionalFields().getItemDescription() != null) { + callNumber = initData.getItemOptionalFields().getItemDescription().getCallNumber(); + } + // VALIDATE PICKUP LOCATION String pickUpLocationCode = initData.getPickupLocation().getValue(); String sPointId = getServicePointId(pickUpLocationCode, baseUrl); @@ -547,7 +552,8 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S item.put(Constants.ID, itemUuid.toString()); item.put(Constants.HOLDINGS_RECORD_ID, holdingsUuid.toString()); item.put("discoverySuppress", true); - item.put("itemLevelCallNumber", itemId.getItemIdentifierValue()); + + item.put("itemLevelCallNumber", StringUtils.isNotBlank(callNumber) ? callNumber : itemId.getItemIdentifierValue()); // PLACE HOLD DOES NOT WORK UNLESS THE ITEM HAS A PERM LOCATION JsonObject permLocation = new JsonObject(); permLocation.put(Constants.ID, itemLocation); From 44a258c492375ce7d0e4410a7e08c8fb9bd26bb2 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Thu, 21 Nov 2024 12:48:09 +0200 Subject: [PATCH 02/15] Update NEWS.md --- NEWS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index add0589..019cf10 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -## 1.15.4 2024-11-12 +## 1.15.6 2024-11-21 +* Fix missing permission issue +* Use item call number from AcceptItem request if it is provided + +## 1.15.5 2024-11-12 * Add new configuration options * Make sure default values are used From 5b594766ecec4a72902e06ae3e1e70100d7af1be Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Thu, 21 Nov 2024 12:48:44 +0200 Subject: [PATCH 03/15] [maven-release-plugin] prepare release v1.15.6 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3906f37..184e068 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.6-SNAPSHOT + 1.15.6 NCIP NCIP responder for FOLIO (internal module) @@ -224,7 +224,7 @@ https://github.com/folio-org/mod-ncip scm:git:git://github.com/folio-org/mod-ncip scm:git:git@github.com:folio-org/mod-ncip.git - HEAD + v1.15.6 From baaefe1c1df2c72875000651a6935e53fbfa31e3 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Thu, 21 Nov 2024 12:48:44 +0200 Subject: [PATCH 04/15] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 184e068..5e021a1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.6 + 1.15.7-SNAPSHOT NCIP NCIP responder for FOLIO (internal module) @@ -224,7 +224,7 @@ https://github.com/folio-org/mod-ncip scm:git:git://github.com/folio-org/mod-ncip scm:git:git@github.com:folio-org/mod-ncip.git - v1.15.6 + HEAD From 008c3071ecd2c4a1c938b3431be5a8487bb190cf Mon Sep 17 00:00:00 2001 From: Roman Barannyk <53909129+roman-barannyk@users.noreply.github.com> Date: Tue, 26 Nov 2024 19:35:28 +0200 Subject: [PATCH 05/15] MODNCIP-79 rename permission (#125) --- descriptors/ModuleDescriptor-template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index 664fd32..f48d53a 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -12,7 +12,7 @@ "permissionsRequired": ["ncip.post"], "modulePermissions": [ "users.collection.get", - "automated-patron-blocks.collection.get", + "patron-blocks.automated-patron-blocks.collection.get", "addresstypes.collection.get", "circulation.requests.item.post", "circulation-storage.circulation-rules.get", From e4a58f588d05090a548caf1a3858e130b971a48b Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 09:16:36 +0200 Subject: [PATCH 06/15] PR-2062 - include additional request ID in the FOLIO loan note. --- src/main/java/org/folio/ncip/Constants.java | 1 + .../folio/ncip/FolioRemoteServiceManager.java | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/folio/ncip/Constants.java b/src/main/java/org/folio/ncip/Constants.java index 68f982b..b79fcee 100644 --- a/src/main/java/org/folio/ncip/Constants.java +++ b/src/main/java/org/folio/ncip/Constants.java @@ -118,6 +118,7 @@ public class Constants { public static final String BOOLEAN_TRUE = "true"; public static final String NOTE_DOMAIN_REQUESTS = "requests"; public static final String NOTE_TITLE_TEMPLATE = "ILL Request id: %s"; + public static final String NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE = "ILL Request id: %s, ILS %s: %s"; public static final String NOTE_LINK_TYPE_REQUEST = "request"; public static final String ITEM_STATUS_UNAVAILABLE = "Unavailable"; diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index f7cd202..2e98a2c 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -421,7 +421,7 @@ public JsonObject checkOut(CheckOutItemInitiationData initData, String agencyId) try { String checkoutResponse = callApiPost(url, jsonObject); JsonObject checkoutResponseAsJson = new JsonObject(checkoutResponse); - addStaffInfoIfNeeded(agencyId, initData.getRequestId(), checkoutResponseAsJson.getString(Constants.ID), baseUrl); + addStaffInfoIfNeeded(agencyId, initData.getRequestId(), checkoutResponseAsJson.getString(Constants.ID), baseUrl, initData.getExternalReference()); return checkoutResponseAsJson; } catch(Exception e) { @@ -446,13 +446,33 @@ public JsonObject checkOut(CheckOutItemInitiationData initData, String agencyId) } } - private void addStaffInfoIfNeeded(String agencyId, RequestId requestId, String loanUuid, String baseUrl){ + private void addStaffInfoIfNeeded(String agencyId, RequestId requestId, String loanUuid, String baseUrl, RequestId externalReference) { String noteEnabled = getProperty(agencyId, "request.note.enabled"); if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled) && requestId != null && - requestId.getRequestIdentifierValue() != null) { + requestId.getRequestIdentifierValue() != null) { + JsonObject staffInfo = new JsonObject(); - staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); - staffInfo.put("actionComment", String.format(Constants.NOTE_TITLE_TEMPLATE, requestId.getRequestIdentifierValue())); + if (externalReference != null + && externalReference.getRequestIdentifierValue() != null + && externalReference.getRequestIdentifierType() != null) { + // Use the custom template if externalReference is passed + staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); + staffInfo.put("actionComment", String.format( + Constants.NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE, + requestId.getRequestIdentifierValue(), + externalReference.getRequestIdentifierType().getValue(), + externalReference.getRequestIdentifierValue()) + + ); + } else { + // Use the original template if externalReference is not passed + staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); + staffInfo.put("actionComment", String.format( + Constants.NOTE_TITLE_TEMPLATE, + requestId.getRequestIdentifierValue() + )); + } + try { callApiPost(baseUrl + String.format(Constants.ADD_STAFF_INFO_URL, loanUuid), staffInfo); } catch (Exception e) { From 8b6a8b7801a705ece84f30f3dcefa51dacc19602 Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 09:21:23 +0200 Subject: [PATCH 07/15] Version bump. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5e021a1..78cea02 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.7-SNAPSHOT + 1.15.8-SNAPSHOT NCIP NCIP responder for FOLIO (internal module) From 05ad3c4c43af11361bfd3b3183fbfdb5554377f3 Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 09:26:35 +0200 Subject: [PATCH 08/15] bump trunk version. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 78cea02..d1068fe 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 17 - 4.1.0 + 4.1.2 From 0ed6b93b981701df369474c0a1669532c58cd4de Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 10:16:49 +0200 Subject: [PATCH 09/15] dont upgrade not release version, sanitize code. --- pom.xml | 2 +- .../folio/ncip/FolioRemoteServiceManager.java | 57 ++++++++++--------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index d1068fe..4e85f21 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.8-SNAPSHOT + 1.15.7-SNAPSHOT NCIP NCIP responder for FOLIO (internal module) diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index 2e98a2c..4acd7f5 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -448,40 +448,43 @@ public JsonObject checkOut(CheckOutItemInitiationData initData, String agencyId) private void addStaffInfoIfNeeded(String agencyId, RequestId requestId, String loanUuid, String baseUrl, RequestId externalReference) { String noteEnabled = getProperty(agencyId, "request.note.enabled"); - if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled) && requestId != null && - requestId.getRequestIdentifierValue() != null) { - - JsonObject staffInfo = new JsonObject(); - if (externalReference != null - && externalReference.getRequestIdentifierValue() != null - && externalReference.getRequestIdentifierType() != null) { - // Use the custom template if externalReference is passed - staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); - staffInfo.put("actionComment", String.format( - Constants.NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE, - requestId.getRequestIdentifierValue(), - externalReference.getRequestIdentifierType().getValue(), - externalReference.getRequestIdentifierValue()) + if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled) && requestId != null) { + String requestIdentifierValue = requestId.getRequestIdentifierValue(); - ); - } else { - // Use the original template if externalReference is not passed + if (requestIdentifierValue != null) { + JsonObject staffInfo = new JsonObject(); + String actionComment = generateActionComment(requestIdentifierValue, externalReference); staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); - staffInfo.put("actionComment", String.format( - Constants.NOTE_TITLE_TEMPLATE, - requestId.getRequestIdentifierValue() - )); - } + staffInfo.put("actionComment", actionComment); - try { - callApiPost(baseUrl + String.format(Constants.ADD_STAFF_INFO_URL, loanUuid), staffInfo); - } catch (Exception e) { - logger.error("Unable to add staff info to loan: {}", loanUuid); - logger.error(e.getMessage()); + try { + callApiPost(baseUrl + String.format(Constants.ADD_STAFF_INFO_URL, loanUuid), staffInfo); + } catch (Exception e) { + logger.error("Unable to add staff info to loan: {}", loanUuid); + logger.error(e.getMessage()); + } } } } + private String generateActionComment(String requestIdentifierValue, RequestId externalReference) { + if (externalReference != null && + externalReference.getRequestIdentifierValue() != null && + externalReference.getRequestIdentifierType() != null) { + return String.format( + Constants.NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE, + requestIdentifierValue, + externalReference.getRequestIdentifierType().getValue(), + externalReference.getRequestIdentifierValue() + ); + } else { + return String.format( + Constants.NOTE_TITLE_TEMPLATE, + requestIdentifierValue + ); + } + } + /** * The acceptItem method: 1) creates an instance (bib) 2) creates a holding * record 3) creates an item 4) places the item on hold From b10ea1ac55ccfdf04b5e7267530d7d85395d5f17 Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 12:20:52 +0200 Subject: [PATCH 10/15] Fix wording --- src/main/java/org/folio/ncip/Constants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/folio/ncip/Constants.java b/src/main/java/org/folio/ncip/Constants.java index b79fcee..170cbde 100644 --- a/src/main/java/org/folio/ncip/Constants.java +++ b/src/main/java/org/folio/ncip/Constants.java @@ -117,8 +117,8 @@ public class Constants { public static final String DEFAULT_FEE_STATUS = "Open"; public static final String BOOLEAN_TRUE = "true"; public static final String NOTE_DOMAIN_REQUESTS = "requests"; - public static final String NOTE_TITLE_TEMPLATE = "ILL Request id: %s"; - public static final String NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE = "ILL Request id: %s, ILS %s: %s"; + public static final String NOTE_TITLE_TEMPLATE = "ILL Request ID: %s"; + public static final String NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE = "ILL Request ID: %s, ILS %s: %s"; public static final String NOTE_LINK_TYPE_REQUEST = "request"; public static final String ITEM_STATUS_UNAVAILABLE = "Unavailable"; From a66a9baf9686906f28b50f2baaca396cbdc26a0f Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 14:38:59 +0200 Subject: [PATCH 11/15] fix typo. --- src/main/java/org/folio/ncip/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/folio/ncip/Constants.java b/src/main/java/org/folio/ncip/Constants.java index 170cbde..374d992 100644 --- a/src/main/java/org/folio/ncip/Constants.java +++ b/src/main/java/org/folio/ncip/Constants.java @@ -118,7 +118,7 @@ public class Constants { public static final String BOOLEAN_TRUE = "true"; public static final String NOTE_DOMAIN_REQUESTS = "requests"; public static final String NOTE_TITLE_TEMPLATE = "ILL Request ID: %s"; - public static final String NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE = "ILL Request ID: %s, ILS %s: %s"; + public static final String NOTE_TITLE_TEMPLATE_CUSTOM_EXTERNAL_REFERNECE = "ILL Request ID: %s, ILL %s: %s"; public static final String NOTE_LINK_TYPE_REQUEST = "request"; public static final String ITEM_STATUS_UNAVAILABLE = "Unavailable"; From 40fc387ad2da644de22aced54afabaa0f858af01 Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 14:42:01 +0200 Subject: [PATCH 12/15] version fix for trunk --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e85f21..9d4b8bb 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ UTF-8 UTF-8 17 - 4.1.2 + 4.1.1 From 6c6a85f0c635d74743adcb137e5fda521ebe0d8b Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 15:45:47 +0200 Subject: [PATCH 13/15] add fields for test --- src/test/resources/mockdata/ncip-checkout-full.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/resources/mockdata/ncip-checkout-full.xml b/src/test/resources/mockdata/ncip-checkout-full.xml index 2cc6cdc..0bb0780 100644 --- a/src/test/resources/mockdata/ncip-checkout-full.xml +++ b/src/test/resources/mockdata/ncip-checkout-full.xml @@ -22,5 +22,12 @@ relais js-test-0015 + + + relais + ExternReferenz + GDFG2343 + + \ No newline at end of file From 86f32a8caf5903f966fdd26443ad033c4a9255b4 Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 16:22:50 +0200 Subject: [PATCH 14/15] Add more tests cases to increase coverage. --- .../java/org/folio/ncip/CheckOutItem.java | 39 ++++++++++++++++++- ...-checkout-null-external-reference-type.xml | 32 +++++++++++++++ ...checkout-null-external-reference-value.xml | 33 ++++++++++++++++ ...out-null-request-id-external-reference.xml | 26 +++++++++++++ .../ncip-checkout-null-request-id.xml | 23 +++++++++++ ...checkout-null-request-identifier-value.xml | 26 +++++++++++++ 6 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/mockdata/ncip-checkout-null-external-reference-type.xml create mode 100644 src/test/resources/mockdata/ncip-checkout-null-external-reference-value.xml create mode 100644 src/test/resources/mockdata/ncip-checkout-null-request-id-external-reference.xml create mode 100644 src/test/resources/mockdata/ncip-checkout-null-request-id.xml create mode 100644 src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml diff --git a/src/test/java/org/folio/ncip/CheckOutItem.java b/src/test/java/org/folio/ncip/CheckOutItem.java index 13c035f..2610ccf 100644 --- a/src/test/java/org/folio/ncip/CheckOutItem.java +++ b/src/test/java/org/folio/ncip/CheckOutItem.java @@ -5,8 +5,7 @@ import java.net.MalformedURLException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; public class CheckOutItem extends TestBase { @@ -18,4 +17,40 @@ public void callCheckOutItem() throws MalformedURLException { assertEquals(200, response.getStatusCode()); assertTrue(body.contains(ITEM_ID)); } + + @Test + public void callCheckOutItemWithoutExternalReference() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-checkout-null-request-id-external-reference.xml"); + String body = response.getBody().prettyPrint(); + assertEquals(200, response.getStatusCode()); + assertTrue(body.contains(ITEM_ID)); + } + + @Test + public void callCheckOutItemWithoutExternalReferenceType() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-checkout-null-external-reference-type.xml"); + String body = response.getBody().prettyPrint(); + assertEquals(200, response.getStatusCode()); + assertTrue(body.contains(ITEM_ID)); + } + + @Test + public void callCheckOutItemEmptyExternalReferenceValue() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-checkout-null-external-reference-value.xml"); + String body = response.getBody().prettyPrint(); + assertEquals(200, response.getStatusCode()); + assertTrue(body.contains(ITEM_ID)); + } + + @Test + public void callCheckOutItem_GivenNoRequestId() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-checkout-null-request-id.xml"); + assertNull(response); + } + + @Test + public void callCheckOutItem_GivenNullRequestIdentifierValue() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml"); + assertNull(response); + } } diff --git a/src/test/resources/mockdata/ncip-checkout-null-external-reference-type.xml b/src/test/resources/mockdata/ncip-checkout-null-external-reference-type.xml new file mode 100644 index 0000000..3eac263 --- /dev/null +++ b/src/test/resources/mockdata/ncip-checkout-null-external-reference-type.xml @@ -0,0 +1,32 @@ + + + + + + relais + + + other + + EZBORROW + + + relais + slnp_one_inst_user + + + relais + tl-a11 + + + relais + js-test-0015 + + + + relais + GDFG2343 + + + + \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-checkout-null-external-reference-value.xml b/src/test/resources/mockdata/ncip-checkout-null-external-reference-value.xml new file mode 100644 index 0000000..c7e0a8d --- /dev/null +++ b/src/test/resources/mockdata/ncip-checkout-null-external-reference-value.xml @@ -0,0 +1,33 @@ + + + + + + relais + + + other + + EZBORROW + + + relais + slnp_one_inst_user + + + relais + tl-a11 + + + relais + js-test-0015 + + + + relais + ExternReferenz + + + + + \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-checkout-null-request-id-external-reference.xml b/src/test/resources/mockdata/ncip-checkout-null-request-id-external-reference.xml new file mode 100644 index 0000000..2cc6cdc --- /dev/null +++ b/src/test/resources/mockdata/ncip-checkout-null-request-id-external-reference.xml @@ -0,0 +1,26 @@ + + + + + + relais + + + other + + EZBORROW + + + relais + slnp_one_inst_user + + + relais + tl-a11 + + + relais + js-test-0015 + + + \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-checkout-null-request-id.xml b/src/test/resources/mockdata/ncip-checkout-null-request-id.xml new file mode 100644 index 0000000..5fa1190 --- /dev/null +++ b/src/test/resources/mockdata/ncip-checkout-null-request-id.xml @@ -0,0 +1,23 @@ + + + + + + relais + + + other + + EZBORROW + + + relais + slnp_one_inst_user + + + relais + tl-a11 + + + + \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml b/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml new file mode 100644 index 0000000..75b14c8 --- /dev/null +++ b/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml @@ -0,0 +1,26 @@ + + + + + + relais + + + other + + EZBORROW + + + relais + slnp_one_inst_user + + + relais + tl-a12 + + + relais + + + + \ No newline at end of file From 143c8e519037663db08a8517354baab829fb50ae Mon Sep 17 00:00:00 2001 From: Edijs Timuls Date: Fri, 6 Dec 2024 16:28:51 +0200 Subject: [PATCH 15/15] create tests that logically work --- .../java/org/folio/ncip/CheckOutItem.java | 12 --------- .../ncip-checkout-null-request-id.xml | 23 ---------------- ...checkout-null-request-identifier-value.xml | 26 ------------------- 3 files changed, 61 deletions(-) delete mode 100644 src/test/resources/mockdata/ncip-checkout-null-request-id.xml delete mode 100644 src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml diff --git a/src/test/java/org/folio/ncip/CheckOutItem.java b/src/test/java/org/folio/ncip/CheckOutItem.java index 2610ccf..c0ed57d 100644 --- a/src/test/java/org/folio/ncip/CheckOutItem.java +++ b/src/test/java/org/folio/ncip/CheckOutItem.java @@ -41,16 +41,4 @@ public void callCheckOutItemEmptyExternalReferenceValue() throws MalformedURLExc assertEquals(200, response.getStatusCode()); assertTrue(body.contains(ITEM_ID)); } - - @Test - public void callCheckOutItem_GivenNoRequestId() throws MalformedURLException { - Response response = postData("src/test/resources/mockdata/ncip-checkout-null-request-id.xml"); - assertNull(response); - } - - @Test - public void callCheckOutItem_GivenNullRequestIdentifierValue() throws MalformedURLException { - Response response = postData("src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml"); - assertNull(response); - } } diff --git a/src/test/resources/mockdata/ncip-checkout-null-request-id.xml b/src/test/resources/mockdata/ncip-checkout-null-request-id.xml deleted file mode 100644 index 5fa1190..0000000 --- a/src/test/resources/mockdata/ncip-checkout-null-request-id.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - relais - - - other - - EZBORROW - - - relais - slnp_one_inst_user - - - relais - tl-a11 - - - - \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml b/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml deleted file mode 100644 index 75b14c8..0000000 --- a/src/test/resources/mockdata/ncip-checkout-null-request-identifier-value.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - relais - - - other - - EZBORROW - - - relais - slnp_one_inst_user - - - relais - tl-a12 - - - relais - - - - \ No newline at end of file