mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish RestartApplicationListenerTests
This commit is contained in:
parent
9152217c96
commit
d095a5e47d
@ -36,7 +36,6 @@ import org.springframework.core.Ordered;
|
|||||||
import org.springframework.test.util.ReflectionTestUtils;
|
import org.springframework.test.util.ReflectionTestUtils;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.hamcrest.Matchers.nullValue;
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,7 +116,7 @@ class RestartApplicationListenerTests {
|
|||||||
SpringApplication application = new SpringApplication();
|
SpringApplication application = new SpringApplication();
|
||||||
ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
|
ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
|
||||||
listener.onApplicationEvent(new ApplicationStartingEvent(bootstrapContext, application, ARGS));
|
listener.onApplicationEvent(new ApplicationStartingEvent(bootstrapContext, application, ARGS));
|
||||||
assertThat(Restarter.getInstance()).isNotEqualTo(nullValue());
|
assertThat(Restarter.getInstance()).isNotNull();
|
||||||
assertThat(Restarter.getInstance().isFinished()).isFalse();
|
assertThat(Restarter.getInstance().isFinished()).isFalse();
|
||||||
listener.onApplicationEvent(new ApplicationPreparedEvent(application, ARGS, context));
|
listener.onApplicationEvent(new ApplicationPreparedEvent(application, ARGS, context));
|
||||||
if (failed) {
|
if (failed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user