@Test
  public void testUploadingImageWithDuplicatedName() throws NameTakenException, ExternalException {
    assertThat(imageBackend.getAll().isEmpty(), is(true));
    imageBackend.prepareImageUpload(inputStream, "image-name", ImageReplicationType.ON_DEMAND);
    imageBackend.prepareImageUpload(inputStream, "image-name", ImageReplicationType.ON_DEMAND);
    flushSession();

    assertThat(imageBackend.getAll().size(), is(2));
  }