feat/issue-751-journey-item-crud-api #791
@@ -1012,7 +1012,7 @@ public class DocumentService {
|
||||
* under the current single-tenant model where all authenticated users share
|
||||
* the same document scope. Called within a caller-provided transaction.
|
||||
*/
|
||||
public Document getSummaryById(UUID id) {
|
||||
public Document findSummaryByIdInternal(UUID id) {
|
||||
return documentRepository.findById(id)
|
||||
.orElseThrow(() -> DomainException.notFound(ErrorCode.DOCUMENT_NOT_FOUND, "Document not found: " + id));
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class JourneyItemService {
|
||||
|
||||
Document doc = null;
|
||||
if (dto.getDocumentId() != null) {
|
||||
doc = documentService.getSummaryById(dto.getDocumentId());
|
||||
doc = documentService.findSummaryByIdInternal(dto.getDocumentId());
|
||||
}
|
||||
|
||||
int nextPosition = journeyItemRepository.findMaxPositionByGeschichteId(geschichteId)
|
||||
|
||||
@@ -240,7 +240,7 @@ class JourneyItemServiceTest {
|
||||
Geschichte journey = journey(geschichteId);
|
||||
when(geschichteQueryService.findById(geschichteId)).thenReturn(Optional.of(journey));
|
||||
when(journeyItemRepository.countByGeschichteId(geschichteId)).thenReturn(0L);
|
||||
when(documentService.getSummaryById(docId))
|
||||
when(documentService.findSummaryByIdInternal(docId))
|
||||
.thenThrow(DomainException.notFound(ErrorCode.DOCUMENT_NOT_FOUND, "not found"));
|
||||
|
||||
JourneyItemCreateDTO dto = new JourneyItemCreateDTO();
|
||||
|
||||
Reference in New Issue
Block a user