@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentImportExecutor,
      TokensAndUrlAuthData authData,
      VideosContainerResource resource)
      throws Exception {
    KoofrClient koofrClient = koofrClientFactory.create(authData);

    monitor.debug(
        () ->
            String.format(
                "%s: Importing %s albums and %s videos",
                jobId, resource.getAlbums().size(), resource.getVideos().size()));

    // TODO: VideosContainerResource does not support transmogrification

    for (VideoAlbum album : resource.getAlbums()) {
      // Create a Koofr folder and then save the id with the mapping data
      idempotentImportExecutor.executeAndSwallowIOExceptions(
          album.getId(), album.getName(), () -> createAlbumFolder(album, koofrClient));
    }

    final LongAdder totalImportedFilesSizes = new LongAdder();
    for (VideoModel videoModel : resource.getVideos()) {
      idempotentImportExecutor.importAndSwallowIOExceptions(
          videoModel,
          video -> {
            ItemImportResult<String> fileImportResult =
                importSingleVideo(videoModel, jobId, idempotentImportExecutor, koofrClient);
            if (fileImportResult != null && fileImportResult.hasBytes()) {
              totalImportedFilesSizes.add(fileImportResult.getBytes());
            }
            return fileImportResult;
          });
    }
    return ImportResult.OK.copyWithBytes(totalImportedFilesSizes.longValue());
  }
@Test
  public void testSkipNotFoundVideo() throws Exception {
    server.enqueue(new MockResponse().setResponseCode(404).setBody("4567"));

    UUID jobId = UUID.randomUUID();
    Collection<VideoAlbum> albums = ImmutableList.of();

    Collection<VideoModel> videos =
        ImmutableList.of(
            new VideoModel(
                "not_found_video_1.mp4",
                server.url("/not_found.mp4").toString(),
                "Video not founded in CDN",
                "video/mp4",
                "not_found_video_1",
                null,
                false,
                null));

    VideosContainerResource resource = spy(new VideosContainerResource(albums, videos));

    importer.importItem(jobId, executor, authData, resource);

    InOrder clientInOrder = Mockito.inOrder(client);

    clientInOrder.verifyNoMoreInteractions();

    String importResult = capturedResult.get();
    assertEquals(importResult, "skipped-not_found_video_1");
  }