Skip to content

Commit

Permalink
Add check to ensure attachment content is deleted
Browse files Browse the repository at this point in the history
Make sure that attachment content is actually removed from the mongo
database when the attachment is deleted.
  • Loading branch information
Azquelt committed Jan 30, 2017
1 parent fc3cf93 commit e5431a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/fat/java/com/ibm/ws/lars/rest/ApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.gridfs.GridFS;

/**
* Tests for the LARS REST API, which is designed to be compatible with the legacy Massive server.
Expand Down Expand Up @@ -385,6 +386,9 @@ public void testCRUDAttachmentWithContent() throws Exception {

AttachmentList attachmentsAfterDeletion = repository.doGetAllAttachmentsForAsset(returnedAsset.get_id());
assertTrue("Asset should have zero attachments after deletion of only attachment", attachmentsAfterDeletion.isEmpty());

GridFS fs = new GridFS(FatUtils.getMongoDB());
assertEquals("Files in database after delete", 0, fs.getFileList().size());
}

/**
Expand Down

0 comments on commit e5431a6

Please sign in to comment.