Anonymous type can be replaced with lambda
This commit is contained in:
committed by
Josh Cummings
parent
05f42a4995
commit
fb39d9c255
+3
-9
@@ -67,11 +67,7 @@ public class CasAuthenticationFilterTests {
|
||||
request.addParameter("ticket", "ST-0-ER94xMJmn6pha35CQRoZ");
|
||||
|
||||
CasAuthenticationFilter filter = new CasAuthenticationFilter();
|
||||
filter.setAuthenticationManager(new AuthenticationManager() {
|
||||
public Authentication authenticate(Authentication a) {
|
||||
return a;
|
||||
}
|
||||
});
|
||||
filter.setAuthenticationManager(a -> a);
|
||||
|
||||
assertThat(filter.requiresAuthentication(request, new MockHttpServletResponse())).isTrue();
|
||||
|
||||
@@ -83,10 +79,8 @@ public class CasAuthenticationFilterTests {
|
||||
@Test(expected = AuthenticationException.class)
|
||||
public void testNullServiceTicketHandledGracefully() throws Exception {
|
||||
CasAuthenticationFilter filter = new CasAuthenticationFilter();
|
||||
filter.setAuthenticationManager(new AuthenticationManager() {
|
||||
public Authentication authenticate(Authentication a) {
|
||||
throw new BadCredentialsException("Rejected");
|
||||
}
|
||||
filter.setAuthenticationManager(a -> {
|
||||
throw new BadCredentialsException("Rejected");
|
||||
});
|
||||
|
||||
filter.attemptAuthentication(new MockHttpServletRequest(),
|
||||
|
||||
Reference in New Issue
Block a user