mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Closes #620: delete a non-existing document should return 404
This commit is contained in:
parent
e6cfd899e5
commit
c6a685d7c0
@ -400,7 +400,13 @@ public class TestDocumentResource extends BaseJerseyTest {
|
|||||||
.cookie(TokenBasedSecurityFilter.COOKIE_NAME, document1Token)
|
.cookie(TokenBasedSecurityFilter.COOKIE_NAME, document1Token)
|
||||||
.delete(JsonObject.class);
|
.delete(JsonObject.class);
|
||||||
Assert.assertEquals("ok", json.getString("status"));
|
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
|
// Check that the associated files are deleted from FS
|
||||||
java.io.File storedFile = DirectoryUtil.getStorageDirectory().resolve(file1Id).toFile();
|
java.io.File storedFile = DirectoryUtil.getStorageDirectory().resolve(file1Id).toFile();
|
||||||
java.io.File webFile = DirectoryUtil.getStorageDirectory().resolve(file1Id + "_web").toFile();
|
java.io.File webFile = DirectoryUtil.getStorageDirectory().resolve(file1Id + "_web").toFile();
|
||||||
|
Loading…
Reference in New Issue
Block a user