@Override
  public ExportResult<PhotosContainerResource> export(
      UUID jobId, TokensAndUrlAuthData authData, Optional<ExportInformation> exportInformation)
      throws CopyExceptionWithFailureReason {
    Preconditions.checkNotNull(authData);

    KoofrClient koofrClient = koofrClientFactory.create(authData);
    KoofrMediaExport export = new KoofrMediaExport(koofrClient, monitor);

    try {
      export.export();

      List<PhotoAlbum> exportAlbums = export.getPhotoAlbums();
      List<PhotoModel> exportPhotos = export.getPhotos();

      PhotosContainerResource containerResource =
          new PhotosContainerResource(exportAlbums, exportPhotos);

      return new ExportResult<>(ExportResult.ResultType.END, containerResource, null);
    } catch (IOException e) {
      return new ExportResult<>(e);
    }
  }
@Test
  public void testExport() throws Exception {
    when(client.getRootPath()).thenReturn("/Data transfer");
    when(client.listRecursive("/Data transfer")).thenReturn(Fixtures.listRecursiveItems);
    when(client.fileLink("/Data transfer/Album 1/Photo 1.jpg"))
        .thenReturn("https://app-1.koofr.net/content/files/get/Photo+1.jpg?base=TESTBASE");
    when(client.fileLink("/Data transfer/Album 1/Photo 2.jpg"))
        .thenReturn("https://app-1.koofr.net/content/files/get/Photo+2.jpg?base=TESTBASE");
    when(client.fileLink("/Data transfer/Album 2 :heart:/Photo 3.jpg"))
        .thenReturn("https://app-1.koofr.net/content/files/get/Photo+3.jpg?base=TESTBASE");

    UUID jobId = UUID.randomUUID();

    ExportResult<PhotosContainerResource> result =
        exporter.export(jobId, authData, Optional.empty());

    assertEquals(ExportResult.ResultType.END, result.getType());
    assertNull(result.getContinuationData());
    PhotosContainerResource exportedData = result.getExportedData();

    List<PhotoAlbum> expectedAlbums =
        ImmutableList.of(
            new PhotoAlbum("/Album 1", "Album 1", null),
            new PhotoAlbum("/Album 2 :heart:", "Album 2 ❤️", "Album 2 description ❤️"));
    assertEquals(expectedAlbums, exportedData.getAlbums());

    List<PhotoModel> expectedPhotos =
        ImmutableList.of(
            new PhotoModel(
                "Photo 1.jpg",
                "https://app-1.koofr.net/content/files/get/Photo+1.jpg?base=TESTBASE",
                "Photo 1 description",
                "image/jpeg",
                "/Album 1/Photo 1.jpg",
                "/Album 1",
                false,
                new Date(1324824491000L)),
            new PhotoModel(
                "Photo 2.jpg",
                "https://app-1.koofr.net/content/files/get/Photo+2.jpg?base=TESTBASE",
                null,
                "image/jpeg",
                "/Album 1/Photo 2.jpg",
                "/Album 1",
                false,
                new Date(1368774569000L)),
            new PhotoModel(
                "Photo 3.jpg",
                "https://app-1.koofr.net/content/files/get/Photo+3.jpg?base=TESTBASE",
                "Photo 3 description",
                "image/jpeg",
                "/Album 2 :heart:/Photo 3.jpg",
                "/Album 2 :heart:",
                false,
                new Date(1489345497000L)));
    assertEquals(expectedPhotos, exportedData.getPhotos());
  }