Skip to content

Commit 5f176f5

Browse files
committed
Polishing
1 parent 6162e30 commit 5f176f5

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

spring-test/src/main/java/org/springframework/test/context/support/AbstractDelegatingSmartContextLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private boolean supports(SmartContextLoader loader, MergedContextConfiguration m
151151
@Override
152152
public void processContextConfiguration(final ContextConfigurationAttributes configAttributes) {
153153
Assert.notNull(configAttributes, "configAttributes must not be null");
154-
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), String.format(
154+
Assert.isTrue(!(configAttributes.hasLocations() && configAttributes.hasClasses()), () -> String.format(
155155
"Cannot process locations AND classes for context configuration %s: "
156156
+ "configure one or the other, but not both.", configAttributes));
157157

spring-test/src/main/java/org/springframework/test/context/support/AbstractTestContextBootstrapper.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,7 @@ protected MergedContextConfiguration processMergedContextConfiguration(MergedCon
555555

556556

557557
private static boolean areAllEmpty(Collection<?>... collections) {
558-
for (Collection<?> collection : collections) {
559-
if (!collection.isEmpty()) {
560-
return false;
561-
}
562-
}
563-
return true;
558+
return Arrays.stream(collections).allMatch(Collection::isEmpty);
564559
}
565560

566561
}

spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private static String[] mergeLocations(List<TestPropertySourceAttributes> attrib
118118
}
119119
String[] locationsArray = TestContextResourceUtils.convertToClasspathResourcePaths(
120120
attrs.getDeclaringClass(), attrs.getLocations());
121-
locations.addAll(0, Arrays.<String> asList(locationsArray));
121+
locations.addAll(0, Arrays.asList(locationsArray));
122122
if (!attrs.isInheritLocations()) {
123123
break;
124124
}

0 commit comments

Comments
 (0)