diff --git a/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java b/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java index 8e5c0fcb772..b942fbc2f10 100644 --- a/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java @@ -109,7 +109,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor this.cracResource = new CracDelegate().registerResource(); } else if (checkpointOnRefresh) { - throw new IllegalStateException("Checkpoint on refresh requires a CRaC-enabled JVM and 'org.crac:crac' on the classpath"); + throw new IllegalStateException( + "Checkpoint on refresh requires a CRaC-enabled JVM and 'org.crac:crac' on the classpath"); } } diff --git a/spring-core/src/test/java/org/springframework/core/task/support/CompositeTaskDecoratorTests.java b/spring-core/src/test/java/org/springframework/core/task/support/CompositeTaskDecoratorTests.java index 6d279c36ad8..93093575cd0 100644 --- a/spring-core/src/test/java/org/springframework/core/task/support/CompositeTaskDecoratorTests.java +++ b/spring-core/src/test/java/org/springframework/core/task/support/CompositeTaskDecoratorTests.java @@ -58,7 +58,7 @@ class CompositeTaskDecoratorTests { TaskDecorator second = mockNoOpTaskDecorator(); TaskDecorator third = mockNoOpTaskDecorator(); CompositeTaskDecorator taskDecorator = new CompositeTaskDecorator(List.of(first, second, third)); - Runnable runnable = mock(Runnable.class); + Runnable runnable = mock(); taskDecorator.decorate(runnable); InOrder ordered = inOrder(first, second, third); ordered.verify(first).decorate(runnable); @@ -67,13 +67,13 @@ class CompositeTaskDecoratorTests { } @Test - void decorateReuseResultOfPreviousRun() { - Runnable original = mock(Runnable.class); - Runnable firstDecorated = mock(Runnable.class); - TaskDecorator first = mock(TaskDecorator.class); + void decorateReusesResultOfPreviousRun() { + Runnable original = mock(); + Runnable firstDecorated = mock(); + TaskDecorator first = mock(); given(first.decorate(original)).willReturn(firstDecorated); - Runnable secondDecorated = mock(Runnable.class); - TaskDecorator second = mock(TaskDecorator.class); + Runnable secondDecorated = mock(); + TaskDecorator second = mock(); given(second.decorate(firstDecorated)).willReturn(secondDecorated); Runnable result = new CompositeTaskDecorator(List.of(first, second)).decorate(original); assertThat(result).isSameAs(secondDecorated); @@ -82,7 +82,7 @@ class CompositeTaskDecoratorTests { } private TaskDecorator mockNoOpTaskDecorator() { - TaskDecorator mock = mock(TaskDecorator.class); + TaskDecorator mock = mock(); given(mock.decorate(any())).willAnswer(invocation -> invocation.getArguments()[0]); return mock; }