fix(test): update optimistic-lock mock to use JOIN FETCH query method
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m45s
CI / OCR Service Tests (push) Successful in 37s
CI / Backend Unit Tests (push) Failing after 3m5s
CI / Unit & Component Tests (pull_request) Failing after 3m13s
CI / OCR Service Tests (pull_request) Successful in 38s
CI / Backend Unit Tests (pull_request) Failing after 3m14s
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m45s
CI / OCR Service Tests (push) Successful in 37s
CI / Backend Unit Tests (push) Failing after 3m5s
CI / Unit & Component Tests (pull_request) Failing after 3m13s
CI / OCR Service Tests (pull_request) Successful in 38s
CI / Backend Unit Tests (pull_request) Failing after 3m14s
PersonServiceTest wired the mock on findByMentionedPersons_PersonId; the listener now calls findByPersonIdWithMentionsFetched so the mock returned an empty list, suppressing the saveAllAndFlush call and breaking the exception-propagation test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -321,7 +321,7 @@ class PersonServiceTest {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
TranscriptionBlockRepository blockRepo = mock(TranscriptionBlockRepository.class);
|
TranscriptionBlockRepository blockRepo = mock(TranscriptionBlockRepository.class);
|
||||||
when(blockRepo.findByMentionedPersons_PersonId(id))
|
when(blockRepo.findByPersonIdWithMentionsFetched(id))
|
||||||
.thenReturn(List.of(referencingBlock));
|
.thenReturn(List.of(referencingBlock));
|
||||||
when(blockRepo.saveAllAndFlush(any()))
|
when(blockRepo.saveAllAndFlush(any()))
|
||||||
.thenThrow(new ObjectOptimisticLockingFailureException(
|
.thenThrow(new ObjectOptimisticLockingFailureException(
|
||||||
|
|||||||
Reference in New Issue
Block a user