Polishing

This commit is contained in:
Juergen Hoeller 2021-09-30 17:34:22 +02:00
parent a295a28e4b
commit 4f44ae3f28
1 changed files with 11 additions and 11 deletions

View File

@ -89,8 +89,8 @@ public class SpringExtension implements BeforeAllCallback, AfterAllCallback, Tes
* {@link Namespace} in which {@code @Autowired} validation error messages
* are stored, keyed by test class.
*/
private static final Namespace AUTOWIRED_VALIDATION_NAMESPACE = Namespace.create(SpringExtension.class.getName() +
"#autowired.validation");
private static final Namespace AUTOWIRED_VALIDATION_NAMESPACE =
Namespace.create(SpringExtension.class.getName() + "#autowired.validation");
private static final String NO_AUTOWIRED_VIOLATIONS_DETECTED = "NO AUTOWIRED VIOLATIONS DETECTED";
@ -147,8 +147,8 @@ public class SpringExtension implements BeforeAllCallback, AfterAllCallback, Tes
// We save the result in the ExtensionContext.Store so that we don't
// re-validate all methods for the same test class multiple times.
Store store = context.getStore(AUTOWIRED_VALIDATION_NAMESPACE);
String errorMessage = store.getOrComputeIfAbsent(context.getRequiredTestClass(),
testClass -> {
String errorMessage = store.getOrComputeIfAbsent(context.getRequiredTestClass(), testClass -> {
Method[] methodsWithErrors =
ReflectionUtils.getUniqueDeclaredMethods(testClass, autowiredTestOrLifecycleMethodFilter);
return (methodsWithErrors.length == 0 ? NO_AUTOWIRED_VIOLATIONS_DETECTED :