### Question:
ShardImporter { public void importShardByFileId(ShardPresentData shardPresentData) { importShard(shardPresentData, List.of()); log.debug("Before updating BlockchainProcessor from Shard data and RESUME block downloading..."); BlockchainProcessor blockchainProcessor = CDI.current().select(BlockchainProcessor.class).get(); blockchain.update(); blockchainProcessor.resumeBlockchainDownloading(); } @Inject  ShardImporter(ShardDao shardDao, BlockchainConfig blockchainConfig, GenesisImporter genesisImporter, Blockchain blockchain, DerivedTablesRegistry derivedTablesRegistry, CsvImporter csvImporter, Zip zipComponent, DataTagDao dataTagDao, DownloadableFilesManager downloadableFilesManager, AplAppStatus aplAppStatus); void importShardByFileId(ShardPresentData shardPresentData); void importLastShard(int height); boolean canImport(int height); void importShard(ShardPresentData shardPresentData, List<String> excludedTables);  }### Answer:
@Test void importShardByFileIdFaile() { assertThrows(NullPointerException.class, () -> shardImporter.importShardByFileId( new ShardPresentData(null, "fileId", List.of())) ); }
@Test void testImportByFileId() { doReturn(Paths.get("")).when(downloadableFilesManager).mapFileIdToLocalPath("fileId"); doReturn(true).when(zipComponent).extract(Paths.get("").toAbsolutePath().toString(), csvImporter.getDataExportPath().toAbsolutePath().toString(), true); doNothing().when(genesisImporter).importGenesisJson(true); doReturn(List.of()).when(derivedTablesRegistry).getDerivedTableNames(); doReturn(mock(Shard.class)).when(shardDao).getLastShard(); shardImporter.importShardByFileId(new ShardPresentData(null, "fileId", List.of())); verify(blockchain).update(); verify(blockchainProcessor).resumeBlockchainDownloading(); verify(aplAppStatus).durableTaskFinished(null, false, "Shard data import"); }