Polishing

This commit is contained in:
Sam Brannen
2016-07-13 18:18:40 +02:00
parent 6162e30f3c
commit 5f176f50d3
3 changed files with 3 additions and 8 deletions

View File

@@ -151,7 +151,7 @@ public abstract class AbstractDelegatingSmartContextLoader implements SmartConte
@Override
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) {
Assert.notNull(configAttributes, "configAttributes must not be null");
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format(
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), () -> String.format(
"Cannot process locations AND classes for context configuration %s: "
+ "configure one or the other, but not both.", configAttributes));

View File

@@ -555,12 +555,7 @@ public abstract class AbstractTestContextBootstrapper implements TestContextBoot
private static boolean areAllEmpty(Collection<?>... collections) {
for (Collection<?> collection : collections) {
if (!collection.isEmpty()) {
return false;
}
}
return true;
return Arrays.stream(collections).allMatch(Collection::isEmpty);
}
}

View File

@@ -118,7 +118,7 @@ public abstract class TestPropertySourceUtils {
}
String[] locationsArray = TestContextResourceUtils.convertToClasspathResourcePaths(
attrs.getDeclaringClass(), attrs.getLocations());
locations.addAll(0, Arrays.<String> asList(locationsArray));
locations.addAll(0, Arrays.asList(locationsArray));
if (!attrs.isInheritLocations()) {
break;
}