Skip to content

Commit 3b2a16b

Browse files
committed
Polish
Signed-off-by: Johnny Lim <[email protected]>
1 parent 06f66a8 commit 3b2a16b

File tree

8 files changed

+28
-27
lines changed

8 files changed

+28
-27
lines changed

core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ void bindToCollectionWhenNonSequentialShouldThrowException() {
119119
.satisfies((ex) -> {
120120
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
121121
.getUnboundProperties();
122-
assertThat(unbound).hasSize(1);
123-
ConfigurationProperty property = unbound.iterator().next();
124-
assertThat(property.getName()).hasToString("foo[3]");
125-
assertThat(property.getValue()).isEqualTo("3");
122+
assertThat(unbound).singleElement().satisfies((property) -> {
123+
assertThat(property.getName()).hasToString("foo[3]");
124+
assertThat(property.getValue()).isEqualTo("3");
125+
});
126126
});
127127
}
128128

@@ -139,10 +139,10 @@ void bindToCollectionWhenNonKnownIndexedChildNotBoundThrowsException() {
139139
.satisfies((ex) -> {
140140
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
141141
.getUnboundProperties();
142-
assertThat(unbound).hasSize(1);
143-
ConfigurationProperty property = unbound.iterator().next();
144-
assertThat(property.getName()).hasToString("foo[1].missing");
145-
assertThat(property.getValue()).isEqualTo("bad");
142+
assertThat(unbound).singleElement().satisfies((property) -> {
143+
assertThat(property.getName()).hasToString("foo[1].missing");
144+
assertThat(property.getValue()).isEqualTo("bad");
145+
});
146146
});
147147
}
148148

@@ -155,10 +155,10 @@ void bindToNestedCollectionWhenNonKnownIndexed() {
155155
source.put("foo[0].string", "test");
156156
this.sources.add(source);
157157
List<ExampleCollectionBean> list = this.binder.bind("foo", Bindable.listOf(ExampleCollectionBean.class)).get();
158-
assertThat(list).hasSize(1);
159-
ExampleCollectionBean bean = list.get(0);
160-
assertThat(bean.getItems()).containsExactly("a", "b", "d");
161-
assertThat(bean.getString()).isEqualTo("test");
158+
assertThat(list).singleElement().satisfies((bean) -> {
159+
assertThat(bean.getItems()).containsExactly("a", "b", "d");
160+
assertThat(bean.getString()).isEqualTo("test");
161+
});
162162
}
163163

164164
@Test
@@ -173,10 +173,10 @@ void bindToNonScalarCollectionWhenNonSequentialShouldThrowException() {
173173
.satisfies((ex) -> {
174174
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
175175
.getUnboundProperties();
176-
assertThat(unbound).hasSize(1);
177-
ConfigurationProperty property = unbound.iterator().next();
178-
assertThat(property.getName()).hasToString("foo[4].value");
179-
assertThat(property.getValue()).isEqualTo("4");
176+
assertThat(unbound).singleElement().satisfies((property) -> {
177+
assertThat(property.getName()).hasToString("foo[4].value");
178+
assertThat(property.getValue()).isEqualTo("4");
179+
});
180180
});
181181
}
182182

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ Beans used for property conversion are requested very early during the applicati
11731173
Typically, any dependency that you require may not be fully initialized at creation time.
11741174
====
11751175

1176-
TIP: You may want to rename your custom javadoc:org.springframework.core.convert.ConversionService[] if it is not required for configuration keys coercion and only rely on custom converters qualified with javadoc:org.springframework.boot.context.properties.ConfigurationPropertiesBinding[format=annotation].
1176+
TIP: You may want to rename your custom javadoc:org.springframework.core.convert.ConversionService[] if it is not required for configuration keys coercion and only relies on custom converters qualified with javadoc:org.springframework.boot.context.properties.ConfigurationPropertiesBinding[format=annotation].
11771177
When qualifying a `@Bean` method with `@ConfigurationPropertiesBinding`, the method should be `static` to avoid "`bean is not eligible for getting processed by all BeanPostProcessors`" warnings.
11781178

11791179

module/spring-boot-amqp/src/main/java/org/springframework/boot/amqp/autoconfigure/RabbitTemplateConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* properties.
3434
* <p>
3535
* Can be injected into application code and used to define a custom
36-
* {@code RabbitTemplateConfigurer} whose configuration is based upon that produced by
36+
* {@code RabbitTemplate} whose configuration is based upon that produced by
3737
* auto-configuration.
3838
*
3939
* @author Stephane Nicoll

module/spring-boot-http-converter/src/main/java/org/springframework/boot/http/converter/autoconfigure/HttpMessageConvertersProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class HttpMessageConvertersProperties {
3232

3333
/**
34-
* The charset to use for String conversion.
34+
* Charset to use for String conversion.
3535
*/
3636
private Charset stringEncodingCharset = StandardCharsets.UTF_8;
3737

module/spring-boot-observation/src/main/java/org/springframework/boot/observation/autoconfigure/ObservationHandlerGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ default int compareTo(ObservationHandlerGroup other) {
6565
Class<?> handlerType();
6666

6767
/**
68-
* Static factory method to create a {@link ObservationHandlerGroup} with members of
68+
* Static factory method to create an {@link ObservationHandlerGroup} with members of
6969
* the given handler type.
7070
* @param <H> the handler type
7171
* @param handlerType the handler type

module/spring-boot-observation/src/main/java/org/springframework/boot/observation/autoconfigure/ObservationHandlerGroups.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.util.MultiValueMap;
3030

3131
/**
32-
* A collection {@link ObservationHandlerGroup} instance and supporting registration
32+
* A collection of {@link ObservationHandlerGroup} instances and supporting registration
3333
* logic.
3434
*
3535
* @author Andy Wilkinson

module/spring-boot-tracing/src/main/java/org/springframework/boot/tracing/autoconfigure/TracingAndMeterObservationHandlerGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/**
3333
* {@link ObservationHandlerGroup} that considers both {@link TracingObservationHandler}
3434
* and {@link MeterObservationHandler} types as members. This group takes precedence over
35-
* any regular {@link MeterObservationHandler} group in order to use ensure
35+
* any regular {@link MeterObservationHandler} group in order to ensure
3636
* {@link TracingAwareMeterObservationHandler} wrapping is applied during registration.
3737
*
3838
* @author Phillip Webb

module/spring-boot-tracing/src/test/java/org/springframework/boot/tracing/autoconfigure/zipkin/ZipkinConfigurationsOpenTelemetryConfigurationTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ class ZipkinConfigurationsOpenTelemetryConfigurationTests {
4444

4545
@Test
4646
void backsOffWithoutEncoding() {
47-
new ApplicationContextRunner().withUserConfiguration(OpenTelemetryConfiguration.class).run((context) -> {
48-
assertThat(context).hasNotFailed();
49-
assertThat(context).doesNotHaveBean(ZipkinSpanExporter.class);
50-
assertThat(context).doesNotHaveBean(BytesEncoder.class);
51-
});
47+
new ApplicationContextRunner().withConfiguration(AutoConfigurations.of(OpenTelemetryConfiguration.class))
48+
.run((context) -> {
49+
assertThat(context).hasNotFailed();
50+
assertThat(context).doesNotHaveBean(ZipkinSpanExporter.class);
51+
assertThat(context).doesNotHaveBean(BytesEncoder.class);
52+
});
5253
}
5354

5455
@Test

0 commit comments

Comments
 (0)