consistent usage of Apache http status constants (#2432)
This commit is contained in:
parent
1bbf3df0f3
commit
9745bfe374
@ -50,6 +50,7 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -203,10 +204,10 @@ public class RefineServlet extends Butterfly {
|
||||
command.doDelete(request, response);
|
||||
logger.trace("< DELETE {}", commandKey);
|
||||
} else {
|
||||
response.sendError(405);
|
||||
response.sendError(HttpStatus.SC_METHOD_NOT_ALLOWED);
|
||||
}
|
||||
} else {
|
||||
response.sendError(404);
|
||||
response.sendError(HttpStatus.SC_NOT_FOUND);
|
||||
}
|
||||
} else {
|
||||
super.service(request, response);
|
||||
|
@ -44,6 +44,7 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
@ -296,7 +297,7 @@ public class RefineServletTests extends RefineTest {
|
||||
}
|
||||
protected void verifyError404Called(){
|
||||
try {
|
||||
verify(response,times(1)).sendError(404);
|
||||
verify(response,times(1)).sendError(HttpStatus.SC_NOT_FOUND);
|
||||
} catch (IOException e) {
|
||||
Assert.fail();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user