Skip to content

Commit 3ea9c56

Browse files
committed
Merge branch '3.4.x'
Closes gh-44685
2 parents a1d0b31 + 322191f commit 3ea9c56

File tree

20 files changed

+36
-44
lines changed

20 files changed

+36
-44
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.boot.actuate.autoconfigure.data.redis;
1818

19-
import java.util.Map;
20-
2119
import reactor.core.publisher.Flux;
2220

2321
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
@@ -51,8 +49,7 @@
5149
public class RedisReactiveHealthContributorAutoConfiguration extends
5250
CompositeReactiveHealthContributorConfiguration<RedisReactiveHealthIndicator, ReactiveRedisConnectionFactory> {
5351

54-
RedisReactiveHealthContributorAutoConfiguration(
55-
Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories) {
52+
RedisReactiveHealthContributorAutoConfiguration() {
5653
super(RedisReactiveHealthIndicator::new);
5754
}
5855

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,11 @@ TestBean standard() {
123123
@Bean(defaultCandidate = false)
124124
TestBean nonDefault() {
125125
return new TestBean();
126-
127126
}
128127

129128
@Bean(autowireCandidate = false)
130129
TestBean nonAutowire() {
131130
return new TestBean();
132-
133131
}
134132

135133
}
@@ -145,7 +143,6 @@ TestBean standard() {
145143
@Bean(autowireCandidate = false)
146144
TestBean nonAutowire() {
147145
return new TestBean();
148-
149146
}
150147

151148
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SanitizingFunctionTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void applyUnlessFilteredWhenHasFilterTestingFalseReturnsUnfiltered() {
6060
void ifLikelySensitiveFiltersExpected() {
6161
SanitizingFunction function = SanitizingFunction.sanitizeValue().ifLikelySensitive();
6262
assertThat(function).satisfies(this::likelyCredentialChecks, this::likelyUriChecks,
63-
this::likelySenstivePropertyChecks, this::vcapServicesChecks);
63+
this::likelySensitivePropertyChecks, this::vcapServicesChecks);
6464
}
6565

6666
@Test
@@ -103,10 +103,10 @@ private void likelyUriChecks(SanitizingFunction function) {
103103
@Test
104104
void ifLikelySensitivePropertyFiltersExpected() {
105105
SanitizingFunction function = SanitizingFunction.sanitizeValue().ifLikelySensitiveProperty();
106-
assertThat(function).satisfies(this::likelySenstivePropertyChecks);
106+
assertThat(function).satisfies(this::likelySensitivePropertyChecks);
107107
}
108108

109-
private void likelySenstivePropertyChecks(SanitizingFunction function) {
109+
private void likelySensitivePropertyChecks(SanitizingFunction function) {
110110
assertThatApplyingToKey(function, "sun.java.command").has(sanitizedValue());
111111
assertThatApplyingToKey(function, "spring.application.json").has(sanitizedValue());
112112
assertThatApplyingToKey(function, "SPRING_APPLICATION_JSON").has(sanitizedValue());

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
public @interface AutoConfigureBefore {
4545

4646
/**
47-
* The auto-configure classes that should have not yet been applied.
47+
* The auto-configuration classes that should have not yet been applied.
4848
* @return the classes
4949
*/
5050
Class<?>[] value() default {};

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ void entityScanShouldSetManagedTypes() {
7979
@Test
8080
void userTypeResolverShouldBeSet() {
8181
this.contextRunner.run((context) -> {
82-
assertThat(context).hasSingleBean(CassandraConverter.class);
8382
assertThat(context).hasSingleBean(CassandraConverter.class);
8483
assertThat(context.getBean(CassandraConverter.class)).extracting("userTypeResolver")
8584
.isInstanceOf(SimpleUserTypeResolver.class);

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,12 @@ void objectDirectoryMapperExists() {
142142
this.contextRunner.withPropertyValues("spring.ldap.urls:ldap://localhost:389").run((context) -> {
143143
assertThat(context).hasSingleBean(ObjectDirectoryMapper.class);
144144
ObjectDirectoryMapper objectDirectoryMapper = context.getBean(ObjectDirectoryMapper.class);
145-
ApplicationConversionService conversionService = assertThat(objectDirectoryMapper)
146-
.extracting("converterManager")
147-
.extracting("conversionService")
148-
.asInstanceOf(InstanceOfAssertFactories.type(ApplicationConversionService.class))
149-
.actual();
150-
assertThat(conversionService.canConvert(String.class, Name.class)).isTrue();
151-
assertThat(conversionService.canConvert(Name.class, String.class)).isTrue();
145+
assertThat(objectDirectoryMapper).extracting("converterManager")
146+
.extracting("conversionService", InstanceOfAssertFactories.type(ApplicationConversionService.class))
147+
.satisfies((conversionService) -> {
148+
assertThat(conversionService.canConvert(String.class, Name.class)).isTrue();
149+
assertThat(conversionService.canConvert(Name.class, String.class)).isTrue();
150+
});
152151
});
153152
}
154153

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public void log(String message) {
300300
}
301301

302302
/**
303-
* Creates{@link DockerLog} instance based on the provided {@link BuildLog}.
303+
* Creates {@link DockerLog} instance based on the provided {@link BuildLog}.
304304
* <p>
305305
* If the provided {@link BuildLog} instance is an {@link AbstractBuildLog}, the
306306
* method returns a {@link BuildLogAdapter}, otherwise it returns a default

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class DockerApi {
8787
* Create a new {@link DockerApi} instance.
8888
*/
8989
public DockerApi() {
90-
this(HttpTransport.create(null), DockerLog.toSystemOut());
90+
this(null);
9191
}
9292

9393
/**
@@ -96,7 +96,7 @@ public DockerApi() {
9696
* @since 2.4.0
9797
*/
9898
public DockerApi(DockerHostConfiguration dockerHost) {
99-
this(HttpTransport.create(dockerHost), DockerLog.toSystemOut());
99+
this(dockerHost, DockerLog.toSystemOut());
100100
}
101101

102102
/**

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerLog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ public interface DockerLog {
3434
void log(String message);
3535

3636
/**
37-
* Factory method that returns a {@link DockerLog} the outputs to {@link System#out}.
37+
* Factory method that returns a {@link DockerLog} that outputs to {@link System#out}.
3838
* @return {@link DockerLog} instance that logs to system out
3939
*/
4040
static DockerLog toSystemOut() {
4141
return to(System.out);
4242
}
4343

4444
/**
45-
* Factory method that returns a {@link DockerLog} the outputs to a given
45+
* Factory method that returns a {@link DockerLog} that outputs to a given
4646
* {@link PrintStream}.
4747
* @param out the print stream used to output the log
4848
* @return {@link DockerLog} instance that logs to the given print stream

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderTests.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
4848
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
4949
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
50+
import static org.assertj.core.api.Assertions.assertThatNoException;
5051
import static org.mockito.ArgumentMatchers.any;
5152
import static org.mockito.ArgumentMatchers.eq;
5253
import static org.mockito.ArgumentMatchers.isNull;
@@ -73,14 +74,12 @@ void createWhenLogIsNullThrowsException() {
7374

7475
@Test
7576
void createWithDockerConfiguration() {
76-
Builder builder = new Builder(BuildLog.toSystemOut());
77-
assertThat(builder).isNotNull();
77+
assertThatNoException().isThrownBy(() -> new Builder(BuildLog.toSystemOut()));
7878
}
7979

8080
@Test
8181
void createDockerApiWithLogDockerLogDelegate() {
8282
Builder builder = new Builder(BuildLog.toSystemOut());
83-
assertThat(builder).isNotNull();
8483
assertThat(builder).extracting("docker")
8584
.extracting("system")
8685
.extracting("log")
@@ -90,7 +89,6 @@ void createDockerApiWithLogDockerLogDelegate() {
9089
@Test
9190
void createDockerApiWithLogDockerSystemOutDelegate() {
9291
Builder builder = new Builder(mock(BuildLog.class));
93-
assertThat(builder).isNotNull();
9492
assertThat(builder).extracting("docker")
9593
.extracting("system")
9694
.extracting("log")

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public void cleanUp() {
447447
super.cleanUp();
448448
LoggerContext loggerContext = getLoggerContext();
449449
markAsUninitialized(loggerContext);
450-
StatusConsoleListener listener = (StatusConsoleListener) getLoggerContext().getObject(STATUS_LISTENER_KEY);
450+
StatusConsoleListener listener = (StatusConsoleListener) loggerContext.getObject(STATUS_LISTENER_KEY);
451451
if (listener != null) {
452452
StatusLogger.getLogger().removeListener(listener);
453453
loggerContext.removeObject(STATUS_LISTENER_KEY);

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ public final void refresh() throws BeansException, IllegalStateException {
146146
super.refresh();
147147
}
148148
catch (RuntimeException ex) {
149-
try {
150-
WebServer webServer = this.webServer;
151-
if (webServer != null) {
149+
WebServer webServer = this.webServer;
150+
if (webServer != null) {
151+
try {
152152
webServer.stop();
153153
webServer.destroy();
154154
}
155-
}
156-
catch (RuntimeException stopOrDestroyEx) {
157-
ex.addSuppressed(stopOrDestroyEx);
155+
catch (RuntimeException stopOrDestroyEx) {
156+
ex.addSuppressed(stopOrDestroyEx);
157+
}
158158
}
159159
throw ex;
160160
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void createPrinterWhenClassNameInjectsConfiguredPrinter() {
187187
}
188188

189189
@Test
190-
void shouldReturnFalseWhenPrinterIsEmpty() {
190+
void hasCustomPrinterShouldReturnFalseWhenPrinterIsEmpty() {
191191
StackTrace stackTrace = new StackTrace("", null, null, null, null, null);
192192
assertThat(stackTrace.hasCustomPrinter()).isFalse();
193193
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
4545
import static org.mockito.BDDMockito.then;
4646
import static org.mockito.BDDMockito.willThrow;
47+
import static org.mockito.Mockito.never;
4748
import static org.mockito.Mockito.times;
4849

4950
/**
@@ -148,7 +149,7 @@ void whenContextRefreshFailedThenWebServerStopFailedCatchStopException() {
148149
.withStackTraceContaining("WebServer has failed to stop");
149150
WebServer webServer = this.context.getWebServer();
150151
then(webServer).should().stop();
151-
then(webServer).should(times(0)).destroy();
152+
then(webServer).should(never()).destroy();
152153
}
153154

154155
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
import static org.mockito.Mockito.atMost;
8787
import static org.mockito.Mockito.inOrder;
8888
import static org.mockito.Mockito.mock;
89+
import static org.mockito.Mockito.never;
8990
import static org.mockito.Mockito.times;
9091
import static org.mockito.Mockito.withSettings;
9192

@@ -236,7 +237,7 @@ void whenContextRefreshFailedThenWebServerStopFailedCatchStopException() {
236237
.withStackTraceContaining("WebServer has failed to stop");
237238
WebServer webServer = this.context.getWebServer();
238239
then(webServer).should().stop();
239-
then(webServer).should(times(0)).destroy();
240+
then(webServer).should(never()).destroy();
240241
}
241242

242243
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
import static org.mockito.BDDMockito.then;
170170
import static org.mockito.Mockito.inOrder;
171171
import static org.mockito.Mockito.mock;
172-
import static org.mockito.Mockito.times;
172+
import static org.mockito.Mockito.never;
173173

174174
/**
175175
* Base for testing classes that extends {@link AbstractServletWebServerFactory}.
@@ -1193,7 +1193,7 @@ protected void servletContextListenerContextDestroyedIsNotCalledWhenContainerIsS
11931193
this.webServer = getFactory().getWebServer((servletContext) -> servletContext.addListener(listener));
11941194
this.webServer.start();
11951195
this.webServer.stop();
1196-
then(listener).should(times(0)).contextDestroyed(any(ServletContextEvent.class));
1196+
then(listener).should(never()).contextDestroyed(any(ServletContextEvent.class));
11971197
}
11981198

11991199
@Test

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id "org.springframework.boot.docker-test"
55
}
66

7-
description = "Spring Boot Data ElasticSearch smoke test"
7+
description = "Spring Boot Data Elasticsearch smoke test"
88

99
dependencies {
1010
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*/
4040
@Testcontainers(disabledWithoutDocker = true)
4141
@DataElasticsearchTest
42-
class SampleElasticSearch8ApplicationTests {
42+
class SampleElasticsearch8ApplicationTests {
4343

4444
@Container
4545
@ServiceConnection
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
@Testcontainers(disabledWithoutDocker = true)
4040
@DataElasticsearchTest
41-
class SampleElasticSearchApplicationTests {
41+
class SampleElasticsearchApplicationTests {
4242

4343
@Container
4444
@ServiceConnection
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
@Testcontainers(disabledWithoutDocker = true)
4141
@DataElasticsearchTest(
4242
properties = { "spring.elasticsearch.connection-timeout=120s", "spring.elasticsearch.socket-timeout=120s" })
43-
class SampleElasticSearchSslApplicationTests {
43+
class SampleElasticsearchSslApplicationTests {
4444

4545
@Container
4646
@ServiceConnection

0 commit comments

Comments
 (0)