提交 38f6d270 编写于 作者: S Sam Brannen

Delete dead code in tests

上级 b774147d
......@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.filter;
import java.io.IOException;
......@@ -33,9 +34,9 @@ import org.springframework.web.util.WebUtils;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link OncePerRequestFilter}.
*
* @author Rossen Stoyanchev
* @since 5.1.9
*/
......@@ -132,27 +133,10 @@ public class OncePerRequestFilterTests {
private boolean didFilterNestedErrorDispatch;
public void setShouldNotFilter(boolean shouldNotFilter) {
this.shouldNotFilter = shouldNotFilter;
}
public void setShouldNotFilterAsyncDispatch(boolean shouldNotFilterAsyncDispatch) {
this.shouldNotFilterAsyncDispatch = shouldNotFilterAsyncDispatch;
}
public void setShouldNotFilterErrorDispatch(boolean shouldNotFilterErrorDispatch) {
this.shouldNotFilterErrorDispatch = shouldNotFilterErrorDispatch;
}
public boolean didFilter() {
return this.didFilter;
}
public boolean didFilterNestedErrorDispatch() {
return this.didFilterNestedErrorDispatch;
}
public void reset() {
this.didFilter = false;
this.didFilterNestedErrorDispatch = false;
......
......@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.socket.server.support;
import java.io.IOException;
......@@ -20,7 +21,6 @@ import java.util.Collections;
import java.util.Map;
import javax.servlet.ServletException;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.server.ServerHttpRequest;
......@@ -42,24 +42,17 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
/**
* Unit tests for {@link WebSocketHttpRequestHandler}.
*
* @author Rossen Stoyanchev
* @since 5.1.9
*/
public class WebSocketHttpRequestHandlerTests {
private HandshakeHandler handshakeHandler;
private WebSocketHttpRequestHandler requestHandler;
private final HandshakeHandler handshakeHandler = mock(HandshakeHandler.class);
private MockHttpServletResponse response;
private final WebSocketHttpRequestHandler requestHandler = new WebSocketHttpRequestHandler(mock(WebSocketHandler.class), this.handshakeHandler);
@Before
public void setUp() {
this.handshakeHandler = mock(HandshakeHandler.class);
this.requestHandler = new WebSocketHttpRequestHandler(mock(WebSocketHandler.class), this.handshakeHandler);
this.response = new MockHttpServletResponse();
}
private final MockHttpServletResponse response = new MockHttpServletResponse();
@Test
......@@ -105,19 +98,11 @@ public class WebSocketHttpRequestHandlerTests {
private final boolean allowHandshake;
private Exception exception;
private TestInterceptor(boolean allowHandshake) {
this.allowHandshake = allowHandshake;
}
public Exception getException() {
return this.exception;
}
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response,
WebSocketHandler wsHandler, Map<String, Object> attributes) {
......@@ -131,7 +116,6 @@ public class WebSocketHttpRequestHandlerTests {
WebSocketHandler wsHandler, Exception exception) {
response.getHeaders().add("exceptionHeaderName", "exceptionHeaderValue");
this.exception = exception;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册