@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentExecutor,
      TokenSecretAuthData authData,
      PhotosContainerResource data)
      throws Exception {

    // Make the data smugmug compatible
    data.transmogrify(transmogrificationConfig);

    try {
      SmugMugInterface smugMugInterface = getOrCreateSmugMugInterface(authData);
      for (PhotoAlbum album : data.getAlbums()) {
        idempotentExecutor.executeAndSwallowIOExceptions(
            album.getId(),
            album.getName(),
            () -> importSingleAlbum(jobId, album, smugMugInterface));
      }
      for (PhotoModel photo : data.getPhotos()) {
        idempotentExecutor.executeAndSwallowIOExceptions(
            photo.getIdempotentId(),
            photo.getTitle(),
            () -> importSinglePhoto(jobId, idempotentExecutor, photo, smugMugInterface));
      }
    } catch (IOException e) {
      monitor.severe(() -> "Error importing", e);
      return new ImportResult(e);
    }
    return ImportResult.OK;
  }
@Test
  public void importEmptyAlbumName() throws Exception{
    UUID jobId = UUID.randomUUID();
    PhotoAlbum photoAlbum = new PhotoAlbum("albumid", "", "albumDescription");
    PhotosContainerResource photosContainerResource =
        new PhotosContainerResource(Collections.singletonList(photoAlbum), ImmutableList.of());

    SmugMugAlbum smugMugAlbum =
        new SmugMugAlbum(
            "date",
            photoAlbum.getDescription(),
            "Untitled Album",
            "privacy",
            "albumUri1",
            "urlname",
            "weburi");
    SmugMugAlbumResponse mockAlbumResponse =
        new SmugMugAlbumResponse(smugMugAlbum.getUri(), "Locator", "LocatorType", smugMugAlbum);
    when(smugMugInterface.createAlbum(eq(smugMugAlbum.getName()))).thenReturn(mockAlbumResponse);

    // Run test
    SmugMugPhotosImporter importer =
        new SmugMugPhotosImporter(
            smugMugInterface,
            config,
            jobStore,
            new AppCredentials("key", "secret"),
            mock(ObjectMapper.class),
            monitor);
    ImportResult result =
        importer.importItem(
            jobId, EXECUTOR, new TokenSecretAuthData("token", "secret"), photosContainerResource);

    // Verify
    verify(smugMugInterface, atLeastOnce()).createAlbum(ArgumentCaptor.forClass(String.class).capture());
  }