See gh-46505

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim 2025-07-22 23:34:19 +09:00 committed by Stéphane Nicoll
parent 4b6064f4aa
commit a29308dcbc
2 changed files with 17 additions and 17 deletions

View File

@ -33,7 +33,7 @@ import org.springframework.util.CollectionUtils;
* properties.
* <p>
* Can be injected into application code and used to define a custom
* {@code RabbitTemplateConfigurer} whose configuration is based upon that produced by
* {@code RabbitTemplate} whose configuration is based upon that produced by
* auto-configuration.
*
* @author Stephane Nicoll

View File

@ -116,10 +116,10 @@ class CollectionBinderTests {
.satisfies((ex) -> {
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
.getUnboundProperties();
assertThat(unbound).hasSize(1);
ConfigurationProperty property = unbound.iterator().next();
assertThat(property.getName()).hasToString("foo[3]");
assertThat(property.getValue()).isEqualTo("3");
assertThat(unbound).singleElement().satisfies((property) -> {
assertThat(property.getName()).hasToString("foo[3]");
assertThat(property.getValue()).isEqualTo("3");
});
});
}
@ -136,10 +136,10 @@ class CollectionBinderTests {
.satisfies((ex) -> {
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
.getUnboundProperties();
assertThat(unbound).hasSize(1);
ConfigurationProperty property = unbound.iterator().next();
assertThat(property.getName()).hasToString("foo[1].missing");
assertThat(property.getValue()).isEqualTo("bad");
assertThat(unbound).singleElement().satisfies((property) -> {
assertThat(property.getName()).hasToString("foo[1].missing");
assertThat(property.getValue()).isEqualTo("bad");
});
});
}
@ -152,10 +152,10 @@ class CollectionBinderTests {
source.put("foo[0].string", "test");
this.sources.add(source);
List<ExampleCollectionBean> list = this.binder.bind("foo", Bindable.listOf(ExampleCollectionBean.class)).get();
assertThat(list).hasSize(1);
ExampleCollectionBean bean = list.get(0);
assertThat(bean.getItems()).containsExactly("a", "b", "d");
assertThat(bean.getString()).isEqualTo("test");
assertThat(list).singleElement().satisfies((bean) -> {
assertThat(bean.getItems()).containsExactly("a", "b", "d");
assertThat(bean.getString()).isEqualTo("test");
});
}
@Test
@ -170,10 +170,10 @@ class CollectionBinderTests {
.satisfies((ex) -> {
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
.getUnboundProperties();
assertThat(unbound).hasSize(1);
ConfigurationProperty property = unbound.iterator().next();
assertThat(property.getName()).hasToString("foo[4].value");
assertThat(property.getValue()).isEqualTo("4");
assertThat(unbound).singleElement().satisfies((property) -> {
assertThat(property.getName()).hasToString("foo[4].value");
assertThat(property.getValue()).isEqualTo("4");
});
});
}