mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-03 15:59:31 +00:00
Merge branch '4.0.x'
Closes gh-48623
This commit is contained in:
+2
-2
@@ -332,7 +332,7 @@ class HttpClientTransportTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnErrorsAndConentIfProxyAuthError() throws IOException {
|
||||
void shouldReturnContentIfProxyAuthError() throws IOException {
|
||||
givenClientWillReturnResponse();
|
||||
given(this.entity.getContent()).willReturn(getClass().getResourceAsStream("proxy-error.txt"));
|
||||
given(this.response.getCode()).willReturn(HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED);
|
||||
@@ -340,7 +340,7 @@ class HttpClientTransportTests {
|
||||
.satisfies((ex) -> {
|
||||
assertThat(ex.getErrors()).isNull();
|
||||
assertThat(ex.getResponseMessage()).isNull();
|
||||
assertThat(ex.getMessage()).contains("Some kind of procy auth problem!");
|
||||
assertThat(ex.getMessage()).contains("Some kind of proxy auth problem!");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
Some kind of procy auth problem!
|
||||
Some kind of proxy auth problem!
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ public interface JsonWriter<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the a {@link NameProcessor} to be applied when the JSON is written.
|
||||
* Add a {@link NameProcessor} to be applied when the JSON is written.
|
||||
* @param nameProcessor the name processor to add
|
||||
*/
|
||||
public void applyingNameProcessor(NameProcessor nameProcessor) {
|
||||
@@ -316,7 +316,7 @@ public interface JsonWriter<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the a {@link ValueProcessor} to be applied when the JSON is written.
|
||||
* Add a {@link ValueProcessor} to be applied when the JSON is written.
|
||||
* @param valueProcessor the value processor to add
|
||||
*/
|
||||
public void applyingValueProcessor(ValueProcessor<?> valueProcessor) {
|
||||
|
||||
+3
-3
@@ -41,10 +41,10 @@ class CacheCondition extends SpringBootCondition {
|
||||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
|
||||
Assert.isInstanceOf(AnnotationMetadata.class, metadata);
|
||||
return extracted(context, (AnnotationMetadata) metadata);
|
||||
return getOutcome(context, (AnnotationMetadata) metadata);
|
||||
}
|
||||
|
||||
private ConditionOutcome extracted(ConditionContext context, AnnotationMetadata metadata) {
|
||||
private ConditionOutcome getOutcome(ConditionContext context, AnnotationMetadata metadata) {
|
||||
String sourceClass = metadata.getClassName();
|
||||
ConditionMessage.Builder message = ConditionMessage.forCondition("Cache", sourceClass);
|
||||
Environment environment = context.getEnvironment();
|
||||
@@ -53,7 +53,7 @@ class CacheCondition extends SpringBootCondition {
|
||||
if (!specified.isBound()) {
|
||||
return ConditionOutcome.match(message.because("automatic cache type"));
|
||||
}
|
||||
CacheType required = CacheConfigurations.getType(metadata.getClassName());
|
||||
CacheType required = CacheConfigurations.getType(sourceClass);
|
||||
if (specified.get() == required) {
|
||||
return ConditionOutcome.match(message.because(specified.get() + " cache type"));
|
||||
}
|
||||
|
||||
+6
-6
@@ -102,14 +102,14 @@ class PropertiesDataRedisConnectionDetails implements DataRedisConnectionDetails
|
||||
return DataRedisUrl.of(this.properties.getUrl());
|
||||
}
|
||||
|
||||
private List<Node> asNodes(@Nullable List<String> nodes) {
|
||||
private static List<Node> asNodes(@Nullable List<String> nodes) {
|
||||
if (nodes == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return nodes.stream().map(this::asNode).toList();
|
||||
return nodes.stream().map(PropertiesDataRedisConnectionDetails::asNode).toList();
|
||||
}
|
||||
|
||||
private Node asNode(String node) {
|
||||
private static Node asNode(String node) {
|
||||
int portSeparatorIndex = node.lastIndexOf(':');
|
||||
String host = node.substring(0, portSeparatorIndex);
|
||||
int port = Integer.parseInt(node.substring(portSeparatorIndex + 1));
|
||||
@@ -119,7 +119,7 @@ class PropertiesDataRedisConnectionDetails implements DataRedisConnectionDetails
|
||||
/**
|
||||
* {@link Cluster} implementation backed by properties.
|
||||
*/
|
||||
private class PropertiesCluster implements Cluster {
|
||||
private static class PropertiesCluster implements Cluster {
|
||||
|
||||
private final List<Node> nodes;
|
||||
|
||||
@@ -137,7 +137,7 @@ class PropertiesDataRedisConnectionDetails implements DataRedisConnectionDetails
|
||||
/**
|
||||
* {@link MasterReplica} implementation backed by properties.
|
||||
*/
|
||||
private class PropertiesMasterReplica implements MasterReplica {
|
||||
private static class PropertiesMasterReplica implements MasterReplica {
|
||||
|
||||
private final List<Node> nodes;
|
||||
|
||||
@@ -155,7 +155,7 @@ class PropertiesDataRedisConnectionDetails implements DataRedisConnectionDetails
|
||||
/**
|
||||
* {@link Sentinel} implementation backed by properties.
|
||||
*/
|
||||
private class PropertiesSentinel implements Sentinel {
|
||||
private static class PropertiesSentinel implements Sentinel {
|
||||
|
||||
private final int database;
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public interface ElasticsearchConnectionDetails extends ConnectionDetails {
|
||||
}
|
||||
|
||||
/**
|
||||
* APIKey for authentication with Elasticsearch.
|
||||
* API key for authentication with Elasticsearch.
|
||||
* @return the API key for authentication with Elasticsearch or {@code null}
|
||||
*/
|
||||
default @Nullable String getApiKey() {
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ class ElasticsearchRestClientConfigurations {
|
||||
.toArray(HttpHost[]::new));
|
||||
if (connectionDetails.getApiKey() != null) {
|
||||
builder.setDefaultHeaders(
|
||||
new Header[] { new BasicHeader("Authorization", "ApiKey " + connectionDetails.getApiKey()), });
|
||||
new Header[] { new BasicHeader("Authorization", "ApiKey " + connectionDetails.getApiKey()) });
|
||||
}
|
||||
builder.setHttpClientConfigCallback((httpClientBuilder) -> builderCustomizers.orderedStream()
|
||||
.forEach((customizer) -> customizer.customize(httpClientBuilder)));
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ class AvailabilityProbesAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void probesWhenPropertyDisabledAddsNotBeans() {
|
||||
void probesWhenPropertyDisabledDoesNotAddBeans() {
|
||||
this.contextRunner.withPropertyValues("management.endpoint.health.probes.enabled=false")
|
||||
.run(this::doesNotHaveProbeBeans);
|
||||
}
|
||||
|
||||
+1
-1
@@ -233,7 +233,7 @@ class MongoAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void configureUUidRepresentation() {
|
||||
void configureUuidRepresentation() {
|
||||
this.contextRunner.withPropertyValues("spring.mongodb.representation.uuid=standard")
|
||||
.run((context) -> assertThat(getSettings(context).getUuidRepresentation())
|
||||
.isEqualTo(UuidRepresentation.STANDARD));
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class MongoPropertiesTests {
|
||||
|
||||
@Test
|
||||
void defaultUUidRepresentationIsAlignedWithSpringData() {
|
||||
void defaultUuidRepresentationIsAlignedWithSpringData() {
|
||||
UuidRepresentation springDataDefault = springDataDefaultUuidRepresentation();
|
||||
UuidRepresentation springBootDefault = new MongoProperties().getRepresentation().getUuid();
|
||||
assertThat(springBootDefault).isEqualTo(springDataDefault);
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class TomcatEmbeddedContext extends StandardContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the a strategy used to capture and rethrow deferred startup exceptions.
|
||||
* Set a strategy used to capture and rethrow deferred startup exceptions.
|
||||
* @param deferredStartupExceptions the strategy to use
|
||||
*/
|
||||
public void setDeferredStartupExceptions(DeferredStartupExceptions deferredStartupExceptions) {
|
||||
|
||||
Reference in New Issue
Block a user