Merge branch '1.3.x'

pull/6456/head
Phillip Webb 8 years ago
commit b615070535

@ -263,6 +263,7 @@ public class PropertiesConfigurationFactory<T>
if (this.conversionService != null) {
dataBinder.setConversionService(this.conversionService);
}
dataBinder.setAutoGrowCollectionLimit(Integer.MAX_VALUE);
dataBinder.setIgnoreNestedProperties(this.ignoreNestedProperties);
dataBinder.setIgnoreInvalidFields(this.ignoreInvalidFields);
dataBinder.setIgnoreUnknownFields(this.ignoreUnknownFields);

@ -225,6 +225,20 @@ public class EnableConfigurationPropertiesTests {
assertThat(this.context.getBean(TestProperties.class).getList()).hasSize(2);
}
@Test
public void testCollectionPropertiesBindingWithOver256Elements() {
this.context.register(TestConfiguration.class);
List<String> pairs = new ArrayList<String>();
pairs.add("name:foo");
for (int i = 0; i < 1000; i++) {
pairs.add("list[" + i + "]:" + i);
}
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context,
pairs.toArray(new String[] {}));
this.context.refresh();
assertThat(this.context.getBean(TestProperties.class).getList()).hasSize(1000);
}
@Test
public void testPropertiesBindingWithoutAnnotation() {
this.context.register(InvalidConfiguration.class);

Loading…
Cancel
Save