Merge branch '1.5.x'

pull/8226/head
Stephane Nicoll 8 years ago
commit 8899b93de0

@ -20,6 +20,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@ -222,8 +223,8 @@ public class AutoConfigurationImportSelector
String name = entry.getKey();
Object value = entry.getValue();
if (name.isEmpty() || name.startsWith("[") && value != null) {
excludes.addAll(
StringUtils.commaDelimitedListToSet(String.valueOf(value)));
excludes.addAll(new HashSet<String>(Arrays.asList(StringUtils
.tokenizeToStringArray(String.valueOf(value), ","))));
}
}
return excludes;

@ -130,11 +130,15 @@ public class AutoConfigurationImportSelectorTests {
this.environment.setProperty("spring.autoconfigure.exclude",
FreeMarkerAutoConfiguration.class.getName() + ","
+ MustacheAutoConfiguration.class.getName());
String[] imports = selectImports(BasicEnableAutoConfiguration.class);
assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
assertThat(this.importSelector.getLastEvent().getExclusions()).contains(
FreeMarkerAutoConfiguration.class.getName(),
MustacheAutoConfiguration.class.getName());
testSeveralPropertyExclusionsAreApplied();
}
@Test
public void severalPropertyExclusionsAreAppliedWithExtraSpaces() {
this.environment.setProperty("spring.autoconfigure.exclude",
FreeMarkerAutoConfiguration.class.getName() + " , "
+ MustacheAutoConfiguration.class.getName() + " ");
testSeveralPropertyExclusionsAreApplied();
}
@Test
@ -143,6 +147,10 @@ public class AutoConfigurationImportSelectorTests {
FreeMarkerAutoConfiguration.class.getName());
this.environment.setProperty("spring.autoconfigure.exclude[1]",
MustacheAutoConfiguration.class.getName());
testSeveralPropertyExclusionsAreApplied();
}
private void testSeveralPropertyExclusionsAreApplied() {
String[] imports = selectImports(BasicEnableAutoConfiguration.class);
assertThat(imports).hasSize(getAutoConfigurationClassNames().size() - 2);
assertThat(this.importSelector.getLastEvent().getExclusions()).contains(

Loading…
Cancel
Save