Polishing
This commit is contained in:
@@ -109,7 +109,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
|||||||
this.cracResource = new CracDelegate().registerResource();
|
this.cracResource = new CracDelegate().registerResource();
|
||||||
}
|
}
|
||||||
else if (checkpointOnRefresh) {
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class CompositeTaskDecoratorTests {
|
|||||||
TaskDecorator second = mockNoOpTaskDecorator();
|
TaskDecorator second = mockNoOpTaskDecorator();
|
||||||
TaskDecorator third = mockNoOpTaskDecorator();
|
TaskDecorator third = mockNoOpTaskDecorator();
|
||||||
CompositeTaskDecorator taskDecorator = new CompositeTaskDecorator(List.of(first, second, third));
|
CompositeTaskDecorator taskDecorator = new CompositeTaskDecorator(List.of(first, second, third));
|
||||||
Runnable runnable = mock(Runnable.class);
|
Runnable runnable = mock();
|
||||||
taskDecorator.decorate(runnable);
|
taskDecorator.decorate(runnable);
|
||||||
InOrder ordered = inOrder(first, second, third);
|
InOrder ordered = inOrder(first, second, third);
|
||||||
ordered.verify(first).decorate(runnable);
|
ordered.verify(first).decorate(runnable);
|
||||||
@@ -67,13 +67,13 @@ class CompositeTaskDecoratorTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void decorateReuseResultOfPreviousRun() {
|
void decorateReusesResultOfPreviousRun() {
|
||||||
Runnable original = mock(Runnable.class);
|
Runnable original = mock();
|
||||||
Runnable firstDecorated = mock(Runnable.class);
|
Runnable firstDecorated = mock();
|
||||||
TaskDecorator first = mock(TaskDecorator.class);
|
TaskDecorator first = mock();
|
||||||
given(first.decorate(original)).willReturn(firstDecorated);
|
given(first.decorate(original)).willReturn(firstDecorated);
|
||||||
Runnable secondDecorated = mock(Runnable.class);
|
Runnable secondDecorated = mock();
|
||||||
TaskDecorator second = mock(TaskDecorator.class);
|
TaskDecorator second = mock();
|
||||||
given(second.decorate(firstDecorated)).willReturn(secondDecorated);
|
given(second.decorate(firstDecorated)).willReturn(secondDecorated);
|
||||||
Runnable result = new CompositeTaskDecorator(List.of(first, second)).decorate(original);
|
Runnable result = new CompositeTaskDecorator(List.of(first, second)).decorate(original);
|
||||||
assertThat(result).isSameAs(secondDecorated);
|
assertThat(result).isSameAs(secondDecorated);
|
||||||
@@ -82,7 +82,7 @@ class CompositeTaskDecoratorTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TaskDecorator mockNoOpTaskDecorator() {
|
private TaskDecorator mockNoOpTaskDecorator() {
|
||||||
TaskDecorator mock = mock(TaskDecorator.class);
|
TaskDecorator mock = mock();
|
||||||
given(mock.decorate(any())).willAnswer(invocation -> invocation.getArguments()[0]);
|
given(mock.decorate(any())).willAnswer(invocation -> invocation.getArguments()[0]);
|
||||||
return mock;
|
return mock;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user