Update deprecated basic auth client filters.
1. Update ExchangeFilterFunctions to delegate internally to HttpHeaders.setBasicAuth(user, password). 2. Remove deprecation from ExchangeFilterFunctions.basicAuthentication(String user, String password) It is still useful as a filter to insert the header. 3. Update deprecation notes. Issue: SPR-17099
This commit is contained in:
@@ -37,6 +37,7 @@ import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ExchangeFilterFunctions}.
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class ExchangeFilterFunctionsTests {
|
||||
@@ -94,7 +95,6 @@ public class ExchangeFilterFunctionsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
public void basicAuthenticationUsernamePassword() {
|
||||
ClientRequest request = ClientRequest.create(HttpMethod.GET, DEFAULT_URL).build();
|
||||
ClientResponse response = mock(ClientResponse.class);
|
||||
@@ -113,8 +113,10 @@ public class ExchangeFilterFunctionsTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void basicAuthenticationInvalidCharacters() {
|
||||
ClientRequest request = ClientRequest.create(HttpMethod.GET, DEFAULT_URL).build();
|
||||
ExchangeFunction exchange = r -> Mono.just(mock(ClientResponse.class));
|
||||
|
||||
ExchangeFilterFunctions.basicAuthentication("foo", "\ud83d\udca9");
|
||||
ExchangeFilterFunctions.basicAuthentication("foo", "\ud83d\udca9").filter(request, exchange);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user