Skip to content

Commit a29308d

Browse files
izeyesnicoll
authored andcommitted
Polish
See gh-46505 Signed-off-by: Johnny Lim <[email protected]>
1 parent 4b6064f commit a29308d

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/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

spring-boot-project/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
@@ -116,10 +116,10 @@ void bindToCollectionWhenNonSequentialShouldThrowException() {
116116
.satisfies((ex) -> {
117117
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
118118
.getUnboundProperties();
119-
assertThat(unbound).hasSize(1);
120-
ConfigurationProperty property = unbound.iterator().next();
121-
assertThat(property.getName()).hasToString("foo[3]");
122-
assertThat(property.getValue()).isEqualTo("3");
119+
assertThat(unbound).singleElement().satisfies((property) -> {
120+
assertThat(property.getName()).hasToString("foo[3]");
121+
assertThat(property.getValue()).isEqualTo("3");
122+
});
123123
});
124124
}
125125

@@ -136,10 +136,10 @@ void bindToCollectionWhenNonKnownIndexedChildNotBoundThrowsException() {
136136
.satisfies((ex) -> {
137137
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
138138
.getUnboundProperties();
139-
assertThat(unbound).hasSize(1);
140-
ConfigurationProperty property = unbound.iterator().next();
141-
assertThat(property.getName()).hasToString("foo[1].missing");
142-
assertThat(property.getValue()).isEqualTo("bad");
139+
assertThat(unbound).singleElement().satisfies((property) -> {
140+
assertThat(property.getName()).hasToString("foo[1].missing");
141+
assertThat(property.getValue()).isEqualTo("bad");
142+
});
143143
});
144144
}
145145

@@ -152,10 +152,10 @@ void bindToNestedCollectionWhenNonKnownIndexed() {
152152
source.put("foo[0].string", "test");
153153
this.sources.add(source);
154154
List<ExampleCollectionBean> list = this.binder.bind("foo", Bindable.listOf(ExampleCollectionBean.class)).get();
155-
assertThat(list).hasSize(1);
156-
ExampleCollectionBean bean = list.get(0);
157-
assertThat(bean.getItems()).containsExactly("a", "b", "d");
158-
assertThat(bean.getString()).isEqualTo("test");
155+
assertThat(list).singleElement().satisfies((bean) -> {
156+
assertThat(bean.getItems()).containsExactly("a", "b", "d");
157+
assertThat(bean.getString()).isEqualTo("test");
158+
});
159159
}
160160

161161
@Test
@@ -170,10 +170,10 @@ void bindToNonScalarCollectionWhenNonSequentialShouldThrowException() {
170170
.satisfies((ex) -> {
171171
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
172172
.getUnboundProperties();
173-
assertThat(unbound).hasSize(1);
174-
ConfigurationProperty property = unbound.iterator().next();
175-
assertThat(property.getName()).hasToString("foo[4].value");
176-
assertThat(property.getValue()).isEqualTo("4");
173+
assertThat(unbound).singleElement().satisfies((property) -> {
174+
assertThat(property.getName()).hasToString("foo[4].value");
175+
assertThat(property.getValue()).isEqualTo("4");
176+
});
177177
});
178178
}
179179

0 commit comments

Comments
 (0)