Polish
See gh-46505 Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
parent
4b6064f4aa
commit
a29308dcbc
|
@ -33,7 +33,7 @@ import org.springframework.util.CollectionUtils;
|
||||||
* properties.
|
* properties.
|
||||||
* <p>
|
* <p>
|
||||||
* Can be injected into application code and used to define a custom
|
* 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.
|
* auto-configuration.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
|
|
|
@ -116,10 +116,10 @@ class CollectionBinderTests {
|
||||||
.satisfies((ex) -> {
|
.satisfies((ex) -> {
|
||||||
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
||||||
.getUnboundProperties();
|
.getUnboundProperties();
|
||||||
assertThat(unbound).hasSize(1);
|
assertThat(unbound).singleElement().satisfies((property) -> {
|
||||||
ConfigurationProperty property = unbound.iterator().next();
|
assertThat(property.getName()).hasToString("foo[3]");
|
||||||
assertThat(property.getName()).hasToString("foo[3]");
|
assertThat(property.getValue()).isEqualTo("3");
|
||||||
assertThat(property.getValue()).isEqualTo("3");
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,10 +136,10 @@ class CollectionBinderTests {
|
||||||
.satisfies((ex) -> {
|
.satisfies((ex) -> {
|
||||||
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
||||||
.getUnboundProperties();
|
.getUnboundProperties();
|
||||||
assertThat(unbound).hasSize(1);
|
assertThat(unbound).singleElement().satisfies((property) -> {
|
||||||
ConfigurationProperty property = unbound.iterator().next();
|
assertThat(property.getName()).hasToString("foo[1].missing");
|
||||||
assertThat(property.getName()).hasToString("foo[1].missing");
|
assertThat(property.getValue()).isEqualTo("bad");
|
||||||
assertThat(property.getValue()).isEqualTo("bad");
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,10 +152,10 @@ class CollectionBinderTests {
|
||||||
source.put("foo[0].string", "test");
|
source.put("foo[0].string", "test");
|
||||||
this.sources.add(source);
|
this.sources.add(source);
|
||||||
List<ExampleCollectionBean> list = this.binder.bind("foo", Bindable.listOf(ExampleCollectionBean.class)).get();
|
List<ExampleCollectionBean> list = this.binder.bind("foo", Bindable.listOf(ExampleCollectionBean.class)).get();
|
||||||
assertThat(list).hasSize(1);
|
assertThat(list).singleElement().satisfies((bean) -> {
|
||||||
ExampleCollectionBean bean = list.get(0);
|
assertThat(bean.getItems()).containsExactly("a", "b", "d");
|
||||||
assertThat(bean.getItems()).containsExactly("a", "b", "d");
|
assertThat(bean.getString()).isEqualTo("test");
|
||||||
assertThat(bean.getString()).isEqualTo("test");
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -170,10 +170,10 @@ class CollectionBinderTests {
|
||||||
.satisfies((ex) -> {
|
.satisfies((ex) -> {
|
||||||
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause())
|
||||||
.getUnboundProperties();
|
.getUnboundProperties();
|
||||||
assertThat(unbound).hasSize(1);
|
assertThat(unbound).singleElement().satisfies((property) -> {
|
||||||
ConfigurationProperty property = unbound.iterator().next();
|
assertThat(property.getName()).hasToString("foo[4].value");
|
||||||
assertThat(property.getName()).hasToString("foo[4].value");
|
assertThat(property.getValue()).isEqualTo("4");
|
||||||
assertThat(property.getValue()).isEqualTo("4");
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue