long importPhotos(
      Collection<PhotoModel> photos,
      GPhotosUpload gPhotosUpload)
      throws Exception {
    return gPhotosUpload.uploadItemsViaBatching(
        photos,
        this::importPhotoBatch);
  }
@Test
  public void importPhotoInTempStore() throws Exception {
    PhotoModel photoModel =
        new PhotoModel(
            PHOTO_TITLE,
            IMG_URI,
            PHOTO_DESCRIPTION,
            JPEG_MEDIA_TYPE,
            "oldPhotoID1",
            OLD_ALBUM_ID,
            true);

    Mockito.when(googlePhotosInterface.uploadMediaContent(any(), eq(null))).thenReturn("token1");
    PhotosLibraryClient photosLibraryClient = mock(PhotosLibraryClient.class);
    JobStore jobStore = mock(LocalJobStore.class);
    Mockito.when(jobStore.getStream(any(), any()))
        .thenReturn(
            new TemporaryPerJobDataStore.InputStreamWrapper(
                new ByteArrayInputStream("TestingBytes".getBytes())));
    Mockito.doNothing().when(jobStore).removeData(any(), anyString());

    ConnectionProvider connectionProvider = new ConnectionProvider(jobStore);
    GoogleMediaImporter googleMediaImporter =
        new GoogleMediaImporter(
            null,  /*credentialFactory*/
            jobStore,
            null,  /*jsonFactory*/
            new HashMap<>(),  /*photosInterfacesMap*/
            new HashMap<>(),  /*photosLibraryClientMap*/
            appCredentials,
            googlePhotosInterface,
            connectionProvider,
            monitor,
            1.0  /*writesPerSecond*/);

    BatchMediaItemResponse batchMediaItemResponse =
        new BatchMediaItemResponse(
            new NewMediaItemResult[]{buildMediaItemResult("token1", Code.OK_VALUE)});

    Mockito.when(googlePhotosInterface.createPhotos(any(NewMediaItemUpload.class)))
        .thenReturn(batchMediaItemResponse);

    UUID jobId = UUID.randomUUID();

    googleMediaImporter.importPhotos(Lists.newArrayList(photoModel), new GPhotosUpload(jobId, executor,
        mock(TokensAndUrlAuthData.class)));
    assertTrue(executor.isKeyCached(String.format("%s-%s", OLD_ALBUM_ID, "oldPhotoID1")));
    Mockito.verify(jobStore, Mockito.times(1)).removeData(any(), anyString());
    Mockito.verify(jobStore, Mockito.times(1)).getStream(any(), anyString());
  }