serverAuthenticationEntryPoint->authenticationEntryPoint

Issue: gh-4822
This commit is contained in:
Rob Winch
2017-11-14 15:12:19 -06:00
parent 9cf0dc6b38
commit 9e82fc0b83
5 changed files with 36 additions and 35 deletions

View File

@@ -39,7 +39,7 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class ServerAuthenticationEntryPointFailureHandlerTests {
@Mock
private ServerAuthenticationEntryPoint serverAuthenticationEntryPoint;
private ServerAuthenticationEntryPoint authenticationEntryPoint;
@Mock
private ServerWebExchange exchange;
@Mock
@@ -53,15 +53,15 @@ public class ServerAuthenticationEntryPointFailureHandlerTests {
@Test(expected = IllegalArgumentException.class)
public void constructorWhenNullEntryPointThenException() {
this.serverAuthenticationEntryPoint = null;
new ServerAuthenticationEntryPointFailureHandler(this.serverAuthenticationEntryPoint);
this.authenticationEntryPoint = null;
new ServerAuthenticationEntryPointFailureHandler(this.authenticationEntryPoint);
}
@Test
public void onAuthenticationFailureWhenInvokedThenDelegatesToEntryPoint() {
Mono<Void> result = Mono.empty();
BadCredentialsException e = new BadCredentialsException("Failed");
when(this.serverAuthenticationEntryPoint.commence(this.exchange, e)).thenReturn(result);
when(this.authenticationEntryPoint.commence(this.exchange, e)).thenReturn(result);
assertThat(this.handler.onAuthenticationFailure(this.filterExchange, e)).isEqualTo(result);
}

View File

@@ -66,7 +66,7 @@ public class ExceptionTranslationWebFilterTests {
when(this.deniedHandler.handle(any(), any())).thenReturn(this.deniedPublisher.mono());
when(this.entryPoint.commence(any(), any())).thenReturn(this.entryPointPublisher.mono());
this.filter.setServerAuthenticationEntryPoint(this.entryPoint);
this.filter.setAuthenticationEntryPoint(this.entryPoint);
this.filter.setServerAccessDeniedHandler(this.deniedHandler);
}
@@ -155,6 +155,6 @@ public class ExceptionTranslationWebFilterTests {
@Test(expected = IllegalArgumentException.class)
public void setAuthenticationEntryPointWhenNullThenException() {
this.filter.setServerAuthenticationEntryPoint(null);
this.filter.setAuthenticationEntryPoint(null);
}
}