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.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.http.HttpStatus;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -203,10 +204,10 @@ public class RefineServlet extends Butterfly {
|
|||||||
command.doDelete(request, response);
|
command.doDelete(request, response);
|
||||||
logger.trace("< DELETE {}", commandKey);
|
logger.trace("< DELETE {}", commandKey);
|
||||||
} else {
|
} else {
|
||||||
response.sendError(405);
|
response.sendError(HttpStatus.SC_METHOD_NOT_ALLOWED);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
response.sendError(404);
|
response.sendError(HttpStatus.SC_NOT_FOUND);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.service(request, response);
|
super.service(request, response);
|
||||||
|
@ -44,6 +44,7 @@ import javax.servlet.ServletException;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.http.HttpStatus;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.AfterMethod;
|
import org.testng.annotations.AfterMethod;
|
||||||
@ -296,7 +297,7 @@ public class RefineServletTests extends RefineTest {
|
|||||||
}
|
}
|
||||||
protected void verifyError404Called(){
|
protected void verifyError404Called(){
|
||||||
try {
|
try {
|
||||||
verify(response,times(1)).sendError(404);
|
verify(response,times(1)).sendError(HttpStatus.SC_NOT_FOUND);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user