From b217e2ec05d2747c760b9e819300bdac0ab1c629 Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 18 Feb 2026 09:22:04 -0500 Subject: [PATCH 1/2] [MODORDSTOR-407] Updated search for lines with an encumbrance --- .../java/org/folio/service/orders/OrderRolloverService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/folio/service/orders/OrderRolloverService.java b/src/main/java/org/folio/service/orders/OrderRolloverService.java index b4f61df90..fabf31571 100644 --- a/src/main/java/org/folio/service/orders/OrderRolloverService.java +++ b/src/main/java/org/folio/service/orders/OrderRolloverService.java @@ -68,7 +68,7 @@ public class OrderRolloverService { private static final String PO_LINE_FUND_DISTR_QUERY = "poLine.fundDistribution =/@fundId %s"; // Following cql query filters orders whose po lines do not contain 'encumbrance' value in the entire fundDistribution array. // That condition skips orders already processed in previous fiscal years. - private static final String PO_LINE_NON_EMPTY_ENCUMBRANCE_QUERY = "poLine.fundDistribution == \"*\\\"encumbrance\\\": \\\"*\""; + private static final String PO_LINE_NON_EMPTY_ENCUMBRANCE_QUERY = "poLine.fundDistribution = encumbrance"; private static final String ORDER_TYPE_QUERY = "orderType == %s"; private static final String ENCUMBR_FY_QUERY = "fiscalYearId == \"%s\""; private static final String OR = " or "; From d4f94af5df1a9b7460db5b11de84e74bb9930de8 Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 18 Feb 2026 09:51:05 -0500 Subject: [PATCH 2/2] [MODORDSTOR-407] Another index change; fixed unit tests --- .../org/folio/service/routinglists/RoutingListService.java | 6 +++--- .../org/folio/service/orders/OrderRolloverServiceTest.java | 4 ++-- .../folio/service/routinglists/RoutingListServiceTest.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/folio/service/routinglists/RoutingListService.java b/src/main/java/org/folio/service/routinglists/RoutingListService.java index e7178e2c3..f572762f3 100644 --- a/src/main/java/org/folio/service/routinglists/RoutingListService.java +++ b/src/main/java/org/folio/service/routinglists/RoutingListService.java @@ -141,13 +141,13 @@ private Future getUsersAndCreateTemplate(RoutingList private Future getAddressTypeId(RequestContext requestContext) { var requestEntry = new RequestEntry(ORDER_SETTINGS_ENDPOINT) - .withQuery("key=" + ROUTING_USER_ADDRESS_TYPE_ID); + .withQuery("key==" + ROUTING_USER_ADDRESS_TYPE_ID); return restClient.get(requestEntry, SettingCollection.class, requestContext) .map(settingCollection -> { var settings = settingCollection.getSettings(); if (ObjectUtils.isEmpty(settings) || StringUtils.isBlank(settings.getFirst().getValue())) { - logger.error("getAddressTypeId:: Setting is not found with key={}", ROUTING_USER_ADDRESS_TYPE_ID); - throw new ResourceNotFoundException(String.format("Setting is not found with key=%s", ROUTING_USER_ADDRESS_TYPE_ID)); + logger.error("getAddressTypeId:: Setting is not found with key=={}", ROUTING_USER_ADDRESS_TYPE_ID); + throw new ResourceNotFoundException(String.format("Setting is not found with key==%s", ROUTING_USER_ADDRESS_TYPE_ID)); } return settings.getFirst().getValue(); }); diff --git a/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java b/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java index fcf855c3f..eed950f39 100644 --- a/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java +++ b/src/test/java/org/folio/service/orders/OrderRolloverServiceTest.java @@ -765,7 +765,7 @@ private static Stream testBuildOrderQueryArgs() { Arguments.of("(orderType == One-Time) and (workflowStatus==Open) and (poLine.fundDistribution =/@fundId (%s))", true, List.of(new EncumbranceRollover().withOrderType(EncumbranceRollover.OrderType.ONE_TIME).withBasedOn(EncumbranceRollover.BasedOn.INITIAL_AMOUNT).withIncreaseBy(0d))), - Arguments.of("(orderType == One-Time) and (workflowStatus<>Open) and (poLine.fundDistribution =/@fundId (%s)) and (poLine.fundDistribution == \"*\\\"encumbrance\\\": \\\"*\")", + Arguments.of("(orderType == One-Time) and (workflowStatus<>Open) and (poLine.fundDistribution =/@fundId (%s)) and (poLine.fundDistribution = encumbrance)", false, List.of(new EncumbranceRollover().withOrderType(EncumbranceRollover.OrderType.ONE_TIME).withBasedOn(EncumbranceRollover.BasedOn.INITIAL_AMOUNT).withIncreaseBy(0d))) ); @@ -785,7 +785,7 @@ private static Stream testBuildOrderQueryWithoutSettingsArgs() { return Stream.of( Arguments.of("(workflowStatus==Open) and (poLine.fundDistribution =/@fundId (%s))", true), - Arguments.of("(workflowStatus<>Open) and (poLine.fundDistribution =/@fundId (%s)) and (poLine.fundDistribution == \"*\\\"encumbrance\\\": \\\"*\")", + Arguments.of("(workflowStatus<>Open) and (poLine.fundDistribution =/@fundId (%s)) and (poLine.fundDistribution = encumbrance)", false) ); } diff --git a/src/test/java/org/folio/service/routinglists/RoutingListServiceTest.java b/src/test/java/org/folio/service/routinglists/RoutingListServiceTest.java index 327ce16c1..56f9fad3b 100644 --- a/src/test/java/org/folio/service/routinglists/RoutingListServiceTest.java +++ b/src/test/java/org/folio/service/routinglists/RoutingListServiceTest.java @@ -172,7 +172,7 @@ void throwErrorWhenSettingNotFound(VertxTestContext vertxTestContext) throws IOE vertxTestContext.assertFailure(future).onComplete(result -> { assertTrue(result.failed()); var exception = result.cause().getMessage(); - assertTrue(exception.contains("Setting is not found with key=ROUTING_USER_ADDRESS_TYPE_ID")); + assertTrue(exception.contains("Setting is not found with key==ROUTING_USER_ADDRESS_TYPE_ID")); vertxTestContext.completeNow(); }); }