@Test public void insertExistingTar() throws Exception { TapeArchiveReferentialEntity tapeArchiveReferentialEntity = new TapeArchiveReferentialEntity( "tarId1", new TapeLibraryBuildingOnDiskArchiveStorageLocation(), 10L, "digest1", "date1" ); archiveReferentialRepository.insert(tapeArchiveReferentialEntity); assertThatThrownBy(() -> archiveReferentialRepository.insert(tapeArchiveReferentialEntity)) .isInstanceOf(ArchiveReferentialException.class); }
public void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity) throws ArchiveReferentialException { try { collection.insertOne(toBson(tapeArchiveReferentialEntity)); } catch (MongoException ex) { throw new ArchiveReferentialException( "Could not insert or update archive referential for id " + tapeArchiveReferentialEntity.getArchiveId(), ex); } }
ArchiveReferentialRepository { public void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity) throws ArchiveReferentialException { try { collection.insertOne(toBson(tapeArchiveReferentialEntity)); } catch (MongoException ex) { throw new ArchiveReferentialException( "Could not insert or update archive referential for id " + tapeArchiveReferentialEntity.getArchiveId(), ex); } } }
ArchiveReferentialRepository { public void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity) throws ArchiveReferentialException { try { collection.insertOne(toBson(tapeArchiveReferentialEntity)); } catch (MongoException ex) { throw new ArchiveReferentialException( "Could not insert or update archive referential for id " + tapeArchiveReferentialEntity.getArchiveId(), ex); } } ArchiveReferentialRepository(MongoCollection<Document> collection); }
ArchiveReferentialRepository { public void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity) throws ArchiveReferentialException { try { collection.insertOne(toBson(tapeArchiveReferentialEntity)); } catch (MongoException ex) { throw new ArchiveReferentialException( "Could not insert or update archive referential for id " + tapeArchiveReferentialEntity.getArchiveId(), ex); } } ArchiveReferentialRepository(MongoCollection<Document> collection); void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity); Optional<TapeArchiveReferentialEntity> find(String archiveId); void updateLocationToReadyOnDisk(String archiveId, long size, String digest); void updateLocationToOnTape(String archiveId,
        TapeLibraryOnTapeArchiveStorageLocation onTapeTarStorageLocation); }
ArchiveReferentialRepository { public void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity) throws ArchiveReferentialException { try { collection.insertOne(toBson(tapeArchiveReferentialEntity)); } catch (MongoException ex) { throw new ArchiveReferentialException( "Could not insert or update archive referential for id " + tapeArchiveReferentialEntity.getArchiveId(), ex); } } ArchiveReferentialRepository(MongoCollection<Document> collection); void insert(TapeArchiveReferentialEntity tapeArchiveReferentialEntity); Optional<TapeArchiveReferentialEntity> find(String archiveId); void updateLocationToReadyOnDisk(String archiveId, long size, String digest); void updateLocationToOnTape(String archiveId,
        TapeLibraryOnTapeArchiveStorageLocation onTapeTarStorageLocation);  }