Home / Function/ eventsArePublishedInExpectedOrder() — spring-boot Function Reference

eventsArePublishedInExpectedOrder() — spring-boot Function Reference

Architecture documentation for the eventsArePublishedInExpectedOrder() function in SpringApplicationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  5ecc6adb_d496_8797_1a2b_c5df6b8cd33f["eventsArePublishedInExpectedOrder()"]
  a35da67f_bd4f_4bd0_8fa1_b89b56fc3cb2["isAvailabilityChangeEventWithState()"]
  5ecc6adb_d496_8797_1a2b_c5df6b8cd33f -->|calls| a35da67f_bd4f_4bd0_8fa1_b89b56fc3cb2
  3613e214_49bf_015b_c43f_7f8a1274fb0b["run()"]
  5ecc6adb_d496_8797_1a2b_c5df6b8cd33f -->|calls| 3613e214_49bf_015b_c43f_7f8a1274fb0b
  38fc4cf6_e1f4_234f_e57e_0772756d13fc["onApplicationEvent()"]
  5ecc6adb_d496_8797_1a2b_c5df6b8cd33f -->|calls| 38fc4cf6_e1f4_234f_e57e_0772756d13fc
  style 5ecc6adb_d496_8797_1a2b_c5df6b8cd33f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java lines 388–409

	@Test
	@SuppressWarnings("unchecked")
	void eventsArePublishedInExpectedOrder() {
		SpringApplication application = new SpringApplication(ExampleConfig.class);
		application.setWebApplicationType(WebApplicationType.NONE);
		ApplicationListener<ApplicationEvent> listener = mock(ApplicationListener.class);
		application.addListeners(listener);
		this.context = application.run();
		InOrder inOrder = Mockito.inOrder(listener);
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationStartingEvent.class));
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationEnvironmentPreparedEvent.class));
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationContextInitializedEvent.class));
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationPreparedEvent.class));
		then(listener).should(inOrder).onApplicationEvent(isA(ContextRefreshedEvent.class));
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationStartedEvent.class));
		then(listener).should(inOrder)
			.onApplicationEvent(argThat(isAvailabilityChangeEventWithState(LivenessState.CORRECT)));
		then(listener).should(inOrder).onApplicationEvent(isA(ApplicationReadyEvent.class));
		then(listener).should(inOrder)
			.onApplicationEvent(argThat(isAvailabilityChangeEventWithState(ReadinessState.ACCEPTING_TRAFFIC)));
		inOrder.verifyNoMoreInteractions();
	}

Domain

Subdomains

Frequently Asked Questions

What does eventsArePublishedInExpectedOrder() do?
eventsArePublishedInExpectedOrder() is a function in the spring-boot codebase.
What does eventsArePublishedInExpectedOrder() call?
eventsArePublishedInExpectedOrder() calls 3 function(s): isAvailabilityChangeEventWithState, onApplicationEvent, run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free