|
|
@ -62,7 +62,7 @@ public class RestarterTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
@Before
|
|
|
|
public void setup() {
|
|
|
|
public void setup() {
|
|
|
|
Restarter.setInstance(new TestableRestarter());
|
|
|
|
RestarterInitializer.setRestarterInstance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@After
|
|
|
|
@After
|
|
|
@ -176,6 +176,13 @@ public class RestarterTests {
|
|
|
|
assertThat(Restarter.getInstance().getInitialUrls()).isEqualTo(urls);
|
|
|
|
assertThat(Restarter.getInstance().getInitialUrls()).isEqualTo(urls);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@FunctionalInterface
|
|
|
|
|
|
|
|
private interface WithMainAction {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void perform() throws Exception;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Component
|
|
|
|
@Component
|
|
|
|
@EnableScheduling
|
|
|
|
@EnableScheduling
|
|
|
|
public static class SampleApplication {
|
|
|
|
public static class SampleApplication {
|
|
|
@ -272,4 +279,16 @@ public class RestarterTests {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class RestarterInitializer {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void setRestarterInstance() {
|
|
|
|
|
|
|
|
main(new String[0]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void main(String[] args) {
|
|
|
|
|
|
|
|
Restarter.setInstance(new TestableRestarter());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|