@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentExecutor,
      TokenSecretAuthData authData,
      VideosContainerResource data)
      throws Exception {
    if (data == null) {
      // Nothing to do
      return ImportResult.OK;
    }

    BackblazeDataTransferClient b2Client = b2ClientFactory.getOrCreateB2Client(jobId, authData);

    final LongAdder totalImportedFilesSizes = new LongAdder();
    if (data.getVideos() != null && data.getVideos().size() > 0) {
      for (VideoModel video : data.getVideos()) {
        idempotentExecutor.importAndSwallowIOExceptions(
            video,
            v -> {
              ItemImportResult<String> fileImportResult = importSingleVideo(jobId, b2Client, v);
              if (fileImportResult.hasBytes()) {
                totalImportedFilesSizes.add(fileImportResult.getBytes());
              }
              return fileImportResult;
            });
      }
    }

    return ImportResult.OK.copyWithBytes(totalImportedFilesSizes.longValue());
  }
@Test
  public void testImportVideo() throws Exception {
    String dataId = "dataId";
    String title = "title";
    String videoUrl = "videoUrl";
    String description = "description";
    String encodingFormat = "video/mp4";
    String albumName = "albumName";
    String albumId = "albumId";
    String response = "response";
    UUID jobId = UUID.randomUUID();

    VideoModel videoObject =
        new VideoModel(title, videoUrl, description, encodingFormat, dataId, albumId, false, null);
    ArrayList<VideoModel> videos = new ArrayList<>();
    videos.add(videoObject);
    VideosContainerResource data = mock(VideosContainerResource.class);
    when(data.getVideos()).thenReturn(videos);

    when(executor.getCachedValue(albumId)).thenReturn(albumName);

    when(streamProvider.getInputStreamForItem(jobId, videoObject))
        .thenReturn(new InputStreamWrapper(IOUtils.toInputStream("video content", "UTF-8")));

    when(dataStore.getTempFileFromInputStream(any(), any(), any())).thenReturn(folder.toFile());
    when(client.uploadFile(eq("Video Transfer/dataId.mp4"), any())).thenReturn(response);
    when(clientFactory.getOrCreateB2Client(jobId, authData)).thenReturn(client);

    BackblazeVideosImporter sut =
        new BackblazeVideosImporter(monitor, dataStore, streamProvider, clientFactory);
    sut.importItem(jobId, executor, authData, data);

    ArgumentCaptor<ImportFunction<VideoModel, String>> importCapture =
        ArgumentCaptor.forClass(ImportFunction.class);
    verify(executor, times(1))
        .importAndSwallowIOExceptions(eq(videoObject), importCapture.capture());

    String actual = importCapture.getValue().apply(videoObject).getData();
    assertEquals(response, actual);
  }