mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x' into 4.1.x
Closes gh-51513
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ abstract class AbstractClientHttpRequestFactoryBuilder<T extends ClientHttpReque
|
||||
}
|
||||
|
||||
protected final List<Consumer<T>> mergedCustomizers(Consumer<T> customizer) {
|
||||
Assert.notNull(this.customizers, "'customizer' must not be null");
|
||||
Assert.notNull(customizer, "'customizer' must not be null");
|
||||
return merge(this.customizers, List.of(customizer));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -70,6 +70,7 @@ public interface ClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFact
|
||||
* @return a new {@link ClientHttpRequestFactoryBuilder} instance
|
||||
*/
|
||||
default ClientHttpRequestFactoryBuilder<T> withCustomizer(Consumer<T> customizer) {
|
||||
Assert.notNull(customizer, "'customizer' must not be null");
|
||||
return withCustomizers(List.of(customizer));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ abstract class AbstractClientHttpConnectorBuilder<T extends ClientHttpConnector>
|
||||
}
|
||||
|
||||
protected final List<Consumer<T>> mergedCustomizers(Consumer<T> customizer) {
|
||||
Assert.notNull(this.customizers, "'customizer' must not be null");
|
||||
Assert.notNull(customizer, "'customizer' must not be null");
|
||||
return merge(this.customizers, List.of(customizer));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -68,6 +68,7 @@ public interface ClientHttpConnectorBuilder<T extends ClientHttpConnector> {
|
||||
* @return a new {@link ClientHttpConnectorBuilder} instance
|
||||
*/
|
||||
default ClientHttpConnectorBuilder<T> withCustomizer(Consumer<T> customizer) {
|
||||
Assert.notNull(customizer, "'customizer' must not be null");
|
||||
return withCustomizers(List.of(customizer));
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -55,6 +55,7 @@ import org.springframework.util.StreamUtils;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Base class for {@link ClientHttpRequestFactoryBuilder} tests.
|
||||
@@ -77,6 +78,13 @@ abstract class AbstractClientHttpRequestFactoryBuilderTests<T extends ClientHttp
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("NullAway") // Test null check
|
||||
void withCustomizerWhenCustomizerIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.builder.withCustomizer(null))
|
||||
.withMessage("'customizer' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void buildReturnsRequestFactoryOfExpectedType() {
|
||||
T requestFactory = this.builder.build();
|
||||
|
||||
+8
@@ -59,6 +59,7 @@ import org.springframework.web.reactive.function.client.WebClientRequestExceptio
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Base class for {@link ClientHttpConnectorBuilder} tests.
|
||||
@@ -80,6 +81,13 @@ abstract class AbstractClientHttpConnectorBuilderTests<T extends ClientHttpConne
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("NullAway") // Test null check
|
||||
void withCustomizerWhenCustomizerIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.builder.withCustomizer(null))
|
||||
.withMessage("'customizer' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void buildReturnsConnectorOfExpectedType() {
|
||||
T connector = this.builder.build();
|
||||
|
||||
Reference in New Issue
Block a user