Skip to content

Commit

Permalink
deprecate mock methods to avoid warnings (#3463)
Browse files Browse the repository at this point in the history
* deprecate mock methods to avoid warnings
* mock method argument names
  • Loading branch information
elharo authored Jun 11, 2019
1 parent 00014d6 commit c72a431
Showing 1 changed file with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</#if>import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
import java.util.Locale;
<#if servletVersion != "2.5">import java.util.Collection;
</#if>import java.util.Locale;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
Expand Down Expand Up @@ -85,7 +85,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
}

@Override
public void setBufferSize(int arg0) {
public void setBufferSize(int size) {
}

@Override
Expand All @@ -94,84 +94,84 @@ public class MockHttpServletResponse implements HttpServletResponse {
}

@Override
public void setContentLength(int arg0) {
public void setContentLength(int length) {
}

@Override
public void setLocale(Locale arg0) {
public void setLocale(Locale locale) {
}

@Override
public void addCookie(Cookie arg0) {
public void addCookie(Cookie cookie) {
}

@Override
public void addDateHeader(String arg0, long arg1) {
public void addDateHeader(String name, long date) {
}

@Override
public void addHeader(String arg0, String arg1) {
public void addHeader(String name, String value) {
}

@Override
public void addIntHeader(String arg0, int arg1) {
public void addIntHeader(String name, int value) {
}

@Override
public boolean containsHeader(String arg0) {
public boolean containsHeader(String name) {
return false;
}

@Override
public String encodeRedirectURL(String arg0) {
public String encodeRedirectURL(String url) {
return null;
}

@Override
public String encodeRedirectUrl(String arg0) {
@Override @Deprecated
public String encodeRedirectUrl(String url) {
return null;
}

@Override
public String encodeURL(String arg0) {
public String encodeURL(String url) {
return null;
}

@Override
public String encodeUrl(String arg0) {
@Override @Deprecated
public String encodeUrl(String url) {
return null;
}

@Override
public void sendError(int arg0) throws IOException {
public void sendError(int statusCode) throws IOException {
}

@Override
public void sendError(int arg0, String arg1) throws IOException {
public void sendError(int statusCode, String message) throws IOException {
}

@Override
public void sendRedirect(String arg0) throws IOException {
public void sendRedirect(String url) throws IOException {
}

@Override
public void setDateHeader(String arg0, long arg1) {
public void setDateHeader(String name, long date) {
}

@Override
public void setHeader(String arg0, String arg1) {
public void setHeader(String name, String value) {
}

@Override
public void setIntHeader(String arg0, int arg1) {
public void setIntHeader(String name, int value) {
}

@Override
public void setStatus(int arg0) {
public void setStatus(int statusCode) {
}

@Override
public void setStatus(int arg0, String arg1) {
@Override @Deprecated
public void setStatus(int statusCode, String message) {
}

<#if servletVersion != "2.5"> // Servlet API 3.0 and 3.1 methods
Expand Down

0 comments on commit c72a431

Please sign in to comment.