|
|
|
|
@ -116,11 +116,11 @@ class CollectionBinderTests {
@@ -116,11 +116,11 @@ class CollectionBinderTests {
|
|
|
|
|
.satisfies((ex) -> { |
|
|
|
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause()) |
|
|
|
|
.getUnboundProperties(); |
|
|
|
|
assertThat(unbound).hasSize(1); |
|
|
|
|
ConfigurationProperty property = unbound.iterator().next(); |
|
|
|
|
assertThat(unbound).singleElement().satisfies((property) -> { |
|
|
|
|
assertThat(property.getName()).hasToString("foo[3]"); |
|
|
|
|
assertThat(property.getValue()).isEqualTo("3"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -136,11 +136,11 @@ class CollectionBinderTests {
@@ -136,11 +136,11 @@ class CollectionBinderTests {
|
|
|
|
|
.satisfies((ex) -> { |
|
|
|
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause()) |
|
|
|
|
.getUnboundProperties(); |
|
|
|
|
assertThat(unbound).hasSize(1); |
|
|
|
|
ConfigurationProperty property = unbound.iterator().next(); |
|
|
|
|
assertThat(unbound).singleElement().satisfies((property) -> { |
|
|
|
|
assertThat(property.getName()).hasToString("foo[1].missing"); |
|
|
|
|
assertThat(property.getValue()).isEqualTo("bad"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -152,10 +152,10 @@ class CollectionBinderTests {
@@ -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(list).singleElement().satisfies((bean) -> { |
|
|
|
|
assertThat(bean.getItems()).containsExactly("a", "b", "d"); |
|
|
|
|
assertThat(bean.getString()).isEqualTo("test"); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -170,11 +170,11 @@ class CollectionBinderTests {
@@ -170,11 +170,11 @@ class CollectionBinderTests {
|
|
|
|
|
.satisfies((ex) -> { |
|
|
|
|
Set<ConfigurationProperty> unbound = ((UnboundConfigurationPropertiesException) ex.getCause()) |
|
|
|
|
.getUnboundProperties(); |
|
|
|
|
assertThat(unbound).hasSize(1); |
|
|
|
|
ConfigurationProperty property = unbound.iterator().next(); |
|
|
|
|
assertThat(unbound).singleElement().satisfies((property) -> { |
|
|
|
|
assertThat(property.getName()).hasToString("foo[4].value"); |
|
|
|
|
assertThat(property.getValue()).isEqualTo("4"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|