UseCaseTestUtil.uploadNewFile(client, file);
// store the keys of the meta file to verify them later
UserProfile userProfileBeforeDeletion = UseCaseTestUtil.getUserProfile(client, userCredentials);
KeyPair metaKeyPair = userProfileBeforeDeletion.getFileByPath(file, root).getFileKeys();
MetaFileSmall metaDocumentBeforeDeletion = (MetaFileSmall) UseCaseTestUtil.getMetaFile(client,
metaKeyPair);
Assert.assertNotNull(metaDocumentBeforeDeletion);
// delete the file
UseCaseTestUtil.deleteFile(client, file);
// check if the file is still in the DHT
UserProfile userProfile = UseCaseTestUtil.getUserProfile(client, userCredentials);
Assert.assertNull(userProfile.getFileById(metaKeyPair.getPublic()));
MetaFile metaDocument = UseCaseTestUtil.getMetaFile(client, metaKeyPair, false);
Assert.assertNull(metaDocument);
for (FileVersion version : metaDocumentBeforeDeletion.getVersions()) {
for (MetaChunk metaChunks : version.getMetaChunks()) {
FutureGet get = client.getDataManager().getUnblocked(
new Parameters().setLocationKey(metaChunks.getChunkId()).setContentKey(
H2HConstants.FILE_CHUNK));
get.awaitUninterruptibly();