Skip to content

Commit 70e31a2

Browse files
committed
Implemented Status in util/servlet/MockServletResponse.java
1 parent 79860e6 commit 70e31a2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

logicaldoc-util/src/main/java/com/logicaldoc/util/servlet/MockServletResponse.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class MockServletResponse implements HttpServletResponse {
4242
private String characterEncoding;
4343

4444
private Map<String, String> headers = new HashMap<>();
45+
46+
private int status = HttpServletResponse.SC_OK;
4547

4648
public MockServletResponse(File output) {
4749
super();
@@ -246,13 +248,13 @@ public void setIntHeader(String arg0, int arg1) {
246248
}
247249

248250
@Override
249-
public void setStatus(int arg0) {
250-
// Nothing to do
251+
public void setStatus(int status) {
252+
this.status = status;
251253
}
252254

253255
@Override
254-
public void setStatus(int arg0, String arg1) {
255-
// Nothing to do
256+
public void setStatus(int status, String statusMessage) {
257+
this.status = status;
256258
}
257259

258260
public int getContentLength() {
@@ -287,7 +289,7 @@ public Collection<String> getHeaders(String arg0) {
287289

288290
@Override
289291
public int getStatus() {
290-
return 0;
292+
return this.status;
291293
}
292294

293295
public void clear() {

0 commit comments

Comments
 (0)