mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
Closes #620: delete a non-existing document should return 404
This commit is contained in:
parent
e6cfd899e5
commit
c6a685d7c0
@ -401,6 +401,12 @@ public class TestDocumentResource extends BaseJerseyTest {
|
||||
.delete(JsonObject.class);
|
||||
Assert.assertEquals("ok", json.getString("status"));
|
||||
|
||||
// Deletes a non-existing document
|
||||
response = target().path("/document/69b79238-84bb-4263-a32f-9cbdf8c92188").request()
|
||||
.cookie(TokenBasedSecurityFilter.COOKIE_NAME, document1Token)
|
||||
.delete();
|
||||
Assert.assertEquals(Status.NOT_FOUND, Status.fromStatusCode(response.getStatus()));
|
||||
|
||||
// Check that the associated files are deleted from FS
|
||||
java.io.File storedFile = DirectoryUtil.getStorageDirectory().resolve(file1Id).toFile();
|
||||
java.io.File webFile = DirectoryUtil.getStorageDirectory().resolve(file1Id + "_web").toFile();
|
||||
|
Loading…
Reference in New Issue
Block a user