Use spring Boot events to get exit code
Spring Boot now provides the result of an ExitCodeExceptionMapper via an event called ExitCodeEvent. This commit takes advantage of this new event. Resolves spring-cloud/spring-cloud-task#48
This commit is contained in:
@@ -99,6 +99,7 @@ public class TaskLifecycleListenerTests {
|
||||
context.refresh();
|
||||
RuntimeException exception = new RuntimeException("This was expected");
|
||||
context.publishEvent(new ApplicationFailedEvent(new SpringApplication(), new String[0], context, exception));
|
||||
context.publishEvent(new ContextClosedEvent(context));
|
||||
|
||||
verifyTaskExecution(0, true, 1, exception);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user