Merge pull request #46505 from izeye

* pr/46505:
  Polish

Closes gh-46505
This commit is contained in:
Stéphane Nicoll 2025-07-25 14:19:53 +02:00
commit d95e73ec20
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");
});
});
}