|
|
|
|
@@ -98,7 +98,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
return b;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
CreateTranscriptionBlockDTO dto = new CreateTranscriptionBlockDTO(1, 0.1, 0.2, 0.3, 0.4, "hello", null);
|
|
|
|
|
CreateTranscriptionBlockDTO dto = new CreateTranscriptionBlockDTO(1, 0.1, 0.2, 0.3, 0.4, "hello", null, java.util.List.of());
|
|
|
|
|
|
|
|
|
|
TranscriptionBlock result = transcriptionService.createBlock(docId, dto, userId);
|
|
|
|
|
|
|
|
|
|
@@ -168,7 +168,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
when(documentService.getDocumentById(any())).thenReturn(
|
|
|
|
|
Document.builder().scriptType(ScriptType.TYPEWRITER).build());
|
|
|
|
|
|
|
|
|
|
UpdateTranscriptionBlockDTO dto = new UpdateTranscriptionBlockDTO("new text", null);
|
|
|
|
|
UpdateTranscriptionBlockDTO dto = new UpdateTranscriptionBlockDTO("new text", null, java.util.List.of());
|
|
|
|
|
|
|
|
|
|
TranscriptionBlock result = transcriptionService.updateBlock(docId, blockId, dto, userId);
|
|
|
|
|
|
|
|
|
|
@@ -189,7 +189,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
when(documentService.getDocumentById(any())).thenReturn(
|
|
|
|
|
Document.builder().scriptType(ScriptType.TYPEWRITER).build());
|
|
|
|
|
|
|
|
|
|
UpdateTranscriptionBlockDTO dto = new UpdateTranscriptionBlockDTO("text", "Anrede");
|
|
|
|
|
UpdateTranscriptionBlockDTO dto = new UpdateTranscriptionBlockDTO("text", "Anrede", java.util.List.of());
|
|
|
|
|
|
|
|
|
|
TranscriptionBlock result = transcriptionService.updateBlock(docId, blockId, dto, UUID.randomUUID());
|
|
|
|
|
|
|
|
|
|
@@ -208,7 +208,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
Document.builder().scriptType(ScriptType.TYPEWRITER).build());
|
|
|
|
|
|
|
|
|
|
TranscriptionBlock result = transcriptionService.updateBlock(
|
|
|
|
|
docId, blockId, new UpdateTranscriptionBlockDTO("new", null), UUID.randomUUID());
|
|
|
|
|
docId, blockId, new UpdateTranscriptionBlockDTO("new", null, java.util.List.of()), UUID.randomUUID());
|
|
|
|
|
|
|
|
|
|
assertThat(result.getSource()).isEqualTo(BlockSource.MANUAL);
|
|
|
|
|
}
|
|
|
|
|
@@ -226,7 +226,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
when(documentService.getDocumentById(any())).thenReturn(
|
|
|
|
|
Document.builder().scriptType(ScriptType.HANDWRITING_KURRENT).sender(sender).build());
|
|
|
|
|
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("text", null), UUID.randomUUID());
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("text", null, java.util.List.of()), UUID.randomUUID());
|
|
|
|
|
|
|
|
|
|
verify(senderModelService).checkAndTriggerTraining(senderId);
|
|
|
|
|
}
|
|
|
|
|
@@ -242,7 +242,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
when(documentService.getDocumentById(any())).thenReturn(
|
|
|
|
|
Document.builder().scriptType(ScriptType.HANDWRITING_KURRENT).build());
|
|
|
|
|
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("text", null), UUID.randomUUID());
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("text", null, java.util.List.of()), UUID.randomUUID());
|
|
|
|
|
|
|
|
|
|
verify(senderModelService, never()).checkAndTriggerTraining(any());
|
|
|
|
|
}
|
|
|
|
|
@@ -477,7 +477,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
Document.builder().scriptType(ScriptType.TYPEWRITER).build());
|
|
|
|
|
when(annotationRepository.findById(annotId)).thenReturn(Optional.of(annotation));
|
|
|
|
|
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("new text", null), userId);
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("new text", null, java.util.List.of()), userId);
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
ArgumentCaptor<Map<String, Object>> payloadCaptor = ArgumentCaptor.forClass(Map.class);
|
|
|
|
|
@@ -502,7 +502,7 @@ class TranscriptionServiceTest {
|
|
|
|
|
when(documentService.getDocumentById(any())).thenReturn(
|
|
|
|
|
Document.builder().scriptType(ScriptType.TYPEWRITER).build());
|
|
|
|
|
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("same text", null), userId);
|
|
|
|
|
transcriptionService.updateBlock(docId, blockId, new UpdateTranscriptionBlockDTO("same text", null, java.util.List.of()), userId);
|
|
|
|
|
|
|
|
|
|
verify(auditService, never()).logAfterCommit(any(), any(), any(), any());
|
|
|
|
|
}
|
|
|
|
|
|