Hi. I've spent a couple of days trying to successfully update objects in an index. I've tried a few different approaches which I took from the documentation, but I've not had success. I have run into a variety of strange problems. The latest is a test I created that uses TransactionalIndexedCollection and simply adds an object to the index, creates another object which is identical to the first except for one changed field, retrieves the first object, and then uses index.update() to replace the first object with the new object.
When I run the test, the test never returns from the the index.update call. When I hook up a debugger and pause execution, it shows the thread stuck in park. So it seems like I'm hitting some kind of deadlock.
Here's my test method. Can anyone see anything glaringly wrong with what I'm attempting to do here?
```
@Test
void testUpdateTicket() {
// setup
final String ticketJiraId = "123456";
final Ticket existingTicket = Ticket.builder()
.jiraId(ticketJiraId)
.issueType(IssueType.builder()
.name("Ticket")
.build())
.status(RequestStatus.builder()
.text("Open")
.category(RequestStatusCategory.OPEN)
.build())
.summary("Existing Ticket")
.build();
ticketIndex.add(existingTicket);
final Ticket updatedTicket = existingTicket.toBuilder()
.summary("Updated Ticket")
.build();
final List<Ticket> ticketsToRemove = retrieveTicketsWithJiraId(ticketJiraId).stream()
.filter(ticketToRemove -> !ticketToRemove.equals(updatedTicket))
.collect(Collectors.toList());
// act
ticketIndex.update(ticketsToRemove, Collections.singletonList(updatedTicket));
// verify
final List<Ticket> shouldBeUpdatedTicketList = retrieveTicketsWithJiraId(ticketJiraId);
assertThat(shouldBeUpdatedTicketList).containsExactly(updatedTicket);
}
```
I'm going to work on paring this down into an even simpler self-contained test (it came from a real-world codebase), but I'm hoping to get a conversation started in the meantime. Thank you.
- Clay