@VisibleForTesting // TODO(aksingh737,jzacsh) stop exposing this to unit tests
  public long importPhotos(Collection<PhotoModel> photos, GPhotosUpload gPhotosUpload)
      throws Exception {
    return gPhotosUpload.uploadItemsViaBatching(photos, this::importPhotoBatch);
  }
@Test
  public void importTwoPhotos() throws Exception {
    PhotoModel photoModel1 =
        new PhotoModel(
            PHOTO_TITLE,
            IMG_URI,
            PHOTO_DESCRIPTION,
            JPEG_MEDIA_TYPE,
            "oldPhotoID1",
            OLD_ALBUM_ID,
            false,
            SHA1);
    Mockito.when(googlePhotosInterface.uploadMediaContent(any(), eq(SHA1))).thenReturn("token1");

    PhotoModel photoModel2 =
        new PhotoModel(
            PHOTO_TITLE,
            IMG_URI,
            PHOTO_DESCRIPTION,
            JPEG_MEDIA_TYPE,
            "oldPhotoID2",
            OLD_ALBUM_ID,
            false);
    Mockito.when(googlePhotosInterface.uploadMediaContent(any(), eq(null)))
        .thenReturn("token2");

    BatchMediaItemResponse batchMediaItemResponse =
        new BatchMediaItemResponse(
            new NewMediaItemResult[]{
                buildMediaItemResult("token1", Code.OK_VALUE),
                buildMediaItemResult("token2", Code.OK_VALUE)
            });
    Mockito.when(googlePhotosInterface.createPhotos(any(NewMediaItemUpload.class)))
        .thenReturn(batchMediaItemResponse);

    long length = googlePhotosImporter.importPhotos(Lists.newArrayList(photoModel1, photoModel2),
        new GPhotosUpload(UUID.randomUUID(), executor, Mockito.mock(TokensAndUrlAuthData.class)));
    // Two photos of 32L each imported
    assertEquals(64L, length);
    assertTrue(executor.isKeyCached(String.format("%s-%s", OLD_ALBUM_ID, "oldPhotoID1")));
    assertTrue(executor.isKeyCached(String.format("%s-%s", OLD_ALBUM_ID, "oldPhotoID2")));
  }