1
0
mirror of synced 2026-08-05 09:47:05 +00:00

Anonymous type can be replaced with lambda

This commit is contained in:
Lars Grefer
2019-08-06 23:40:48 +02:00
committed by Josh Cummings
parent 05f42a4995
commit fb39d9c255
53 changed files with 347 additions and 722 deletions
@@ -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(),