Return '404 Not Found' on delete of a non-existing change edit

The current response code '400 Bad Request' is wrong as this indicates
a request that is not understood by the server due to malformed
syntax. In this case the request is syntactically correct but the
resource doesn't exist, hence '404 Not Found' is the correct response.

Change-Id: I13a2ab76150709886141672bc5fe9534a40a8d40
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-10-09 14:08:34 +02:00
committed by Dave Borowitz
parent e3a82235bf
commit bb04b0d2b6
2 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ package com.google.gerrit.acceptance.edit;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.http.HttpStatus.SC_BAD_REQUEST;
import static org.apache.http.HttpStatus.SC_NOT_FOUND;
import static org.apache.http.HttpStatus.SC_NO_CONTENT;
import static org.apache.http.HttpStatus.SC_OK;
import static org.junit.Assert.assertArrayEquals;
@@ -373,7 +373,7 @@ public class ChangeEditIT extends AbstractDaemonTest {
@Test
public void deletingNonExistingEditRest() throws Exception {
RestResponse r = session.delete(urlEdit());
assertEquals(SC_BAD_REQUEST, r.getStatusCode());
assertEquals(SC_NOT_FOUND, r.getStatusCode());
}
@Test