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:
		
				
					committed by
					
						
						Dave Borowitz
					
				
			
			
				
	
			
			
			
						parent
						
							e3a82235bf
						
					
				
				
					commit
					bb04b0d2b6
				
			@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user