mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-10 04:13:31 +00:00
Removed invalid test method.
This commit is contained in:
parent
d1e8b8e29d
commit
ba890cf7e5
@ -237,27 +237,6 @@ public class ExceptionTranslationFilterTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void unexpectedExceptionsAreWrappedAsRuntime() throws Exception {
|
|
||||||
ExceptionTranslationFilter filter = new ExceptionTranslationFilter();
|
|
||||||
|
|
||||||
filter.setAuthenticationEntryPoint(mockEntryPoint());
|
|
||||||
|
|
||||||
Exception e = new Exception("");
|
|
||||||
|
|
||||||
FilterChain fc = mock(FilterChain.class);
|
|
||||||
|
|
||||||
doThrow(e).when(fc).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class));
|
|
||||||
|
|
||||||
try {
|
|
||||||
filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), fc);
|
|
||||||
fail("Should have thrown Exception");
|
|
||||||
}
|
|
||||||
catch (RuntimeException expected) {
|
|
||||||
assertSame(e, expected.getCause());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private AuthenticationEntryPoint mockEntryPoint() {
|
private AuthenticationEntryPoint mockEntryPoint() {
|
||||||
return new AuthenticationEntryPoint() {
|
return new AuthenticationEntryPoint() {
|
||||||
public void commence(HttpServletRequest request, HttpServletResponse response,
|
public void commence(HttpServletRequest request, HttpServletResponse response,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user