-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIRCSTORE-526] Add ILR support for publishing batch request update events #489
Conversation
…n-storage into CIRCSTORE-521 # Conflicts: # ramls/request-queue-reordering.json # src/main/java/org/folio/service/request/RequestBatchResourceService.java # src/test/java/org/folio/rest/api/RequestBatchAPITest.java # src/test/java/org/folio/rest/support/matchers/DomainEventAssertions.java
Quality Gate passedIssues Measures |
|
||
batchResourceService.executeBatchUpdate(allDatabaseOperations, onFinishHandler) | ||
.compose(v -> eventPublisher.publishCreated(payload.getInstanceId(), payload)); | ||
} | ||
|
||
private RequestQueueReordering mapRequestsToPayload(List<Request> requests) { | ||
var firstRequest = requests.get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var firstRequest = requests.get(0); | |
var firstRequest = requests.iterator().next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we work with List in this method (not Collection), accessing an element by index will be more efficient for array-based implementation with constant time complexity O(1)
assertRequestQueueReorderingEvent(instanceId.toString(), | ||
requestsSorted.get(1).getString("itemId"), List.of(firstRequestId, secondRequestId), TITLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m.b. it's a good idea to extract constants ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertRequestQueueReorderingEvent is a universal method that is also applicable to queues with ITEM requestLevel requests
Resolves: CIRCSTORE-526