Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ private Future<TemplateProcessingRequest> getUsersAndCreateTemplate(RoutingList

private Future<String> 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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ private static Stream<Arguments> 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)))
);
Expand All @@ -785,7 +785,7 @@ private static Stream<Arguments> 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)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down