### Question:
ArchiveMerger { public Path createArchiveFromParts(List<FileEntry> archiveParts) { List<FileEntry> sortedArchiveParts = sort(archiveParts); String archiveName = getArchiveName(sortedArchiveParts.get(0)); try (FilePartsMerger filePartsMerger = new FilePartsMerger(archiveName)) { mergeArchiveParts(sortedArchiveParts, filePartsMerger); return filePartsMerger.getMergedFilePath(); } } ArchiveMerger(FileService fileService, StepLogger stepLogger, DelegateExecution execution); Path createArchiveFromParts(List<FileEntry> archiveParts);  }### Answer:
@Test void testCreateArchiveFromPartsFileStorageExceptionThrown() throws FileStorageException { Mockito.doThrow(FileStorageException.class) .when(fileService) .consumeFileContent(any(), any(), any()); Assertions.assertThrows(SLException.class, () -> archiveMerger.createArchiveFromParts(createFileEntriesFromFile(FILE_ENTRIES))); }
@Test void testCreateArchiveFromParts() { List<FileEntry> fileEntries = createFileEntriesFromFile(FILE_ENTRIES); Path archiveFromParts = archiveMerger.createArchiveFromParts(fileEntries); Assertions.assertTrue(archiveFromParts.toString() .endsWith(getArchiveName(fileEntries.get(0)))); }
@Test void testWithArchiveNameWithoutParts() throws FileStorageException { List<FileEntry> fileEntryWithoutParts = createFileEntriesFromFile(FILE_ENTRY_WITHOUT_PARTS); archiveMerger.createArchiveFromParts(fileEntryWithoutParts); Mockito.verify(fileService) .consumeFileContent(any(), any(), any()); }