Use BDD in tests

This commit is contained in:
Steve Riesenberg 2021-12-02 17:40:25 -06:00
parent d37ff18b69
commit aa3c883f87
1 changed files with 2 additions and 3 deletions

View File

@ -62,7 +62,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
/**
* Tests {@link SecurityContextHolderAwareRequestFilter}.
@ -226,8 +225,8 @@ public class SecurityContextHolderAwareRequestFilterTests {
throws Exception {
String ipAddress = "10.0.0.100";
String sessionId = "session-id";
when(this.request.getRemoteAddr()).thenReturn(ipAddress);
when(this.request.getSession(anyBoolean())).thenReturn(new MockHttpSession(null, sessionId));
given(this.request.getRemoteAddr()).willReturn(ipAddress);
given(this.request.getSession(anyBoolean())).willReturn(new MockHttpSession(null, sessionId));
wrappedRequest().login("username", "password");
ArgumentCaptor<UsernamePasswordAuthenticationToken> authenticationCaptor = ArgumentCaptor