|
|
@ -122,6 +122,7 @@ import static org.mockito.BDDMockito.given;
|
|
|
|
import static org.mockito.BDDMockito.willThrow;
|
|
|
|
import static org.mockito.BDDMockito.willThrow;
|
|
|
|
import static org.mockito.Mockito.atLeastOnce;
|
|
|
|
import static org.mockito.Mockito.atLeastOnce;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
|
|
|
import static org.mockito.Mockito.mockingDetails;
|
|
|
|
import static org.mockito.Mockito.never;
|
|
|
|
import static org.mockito.Mockito.never;
|
|
|
|
import static org.mockito.Mockito.spy;
|
|
|
|
import static org.mockito.Mockito.spy;
|
|
|
|
import static org.mockito.Mockito.verify;
|
|
|
|
import static org.mockito.Mockito.verify;
|
|
|
@ -1171,6 +1172,11 @@ class SpringApplicationTests {
|
|
|
|
verify(applicationStartup).start("spring.boot.application.context-loaded");
|
|
|
|
verify(applicationStartup).start("spring.boot.application.context-loaded");
|
|
|
|
verify(applicationStartup).start("spring.boot.application.started");
|
|
|
|
verify(applicationStartup).start("spring.boot.application.started");
|
|
|
|
verify(applicationStartup).start("spring.boot.application.running");
|
|
|
|
verify(applicationStartup).start("spring.boot.application.running");
|
|
|
|
|
|
|
|
long startCount = mockingDetails(applicationStartup).getInvocations().stream()
|
|
|
|
|
|
|
|
.filter((invocation) -> invocation.getMethod().toString().contains("start(")).count();
|
|
|
|
|
|
|
|
long endCount = mockingDetails(startupStep).getInvocations().stream()
|
|
|
|
|
|
|
|
.filter((invocation) -> invocation.getMethod().toString().contains("end(")).count();
|
|
|
|
|
|
|
|
assertThat(startCount).isEqualTo(endCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private <S extends AvailabilityState> ArgumentMatcher<ApplicationEvent> isAvailabilityChangeEventWithState(
|
|
|
|
private <S extends AvailabilityState> ArgumentMatcher<ApplicationEvent> isAvailabilityChangeEventWithState(
|
|
|
|