Home / Class/ ApplicationPropertiesTests Class — spring-boot Architecture

ApplicationPropertiesTests Class — spring-boot Architecture

Architecture documentation for the ApplicationPropertiesTests class in ApplicationPropertiesTests.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/ApplicationPropertiesTests.java lines 34–65

class ApplicationPropertiesTests {

	@Test
	void bannerModeShouldBeConsoleIfStructuredLoggingIsNotEnabled() {
		ApplicationProperties properties = new ApplicationProperties();
		assertThat(properties.getBannerMode(new MockEnvironment())).isEqualTo(Mode.CONSOLE);
	}

	@Test
	void bannerModeShouldBeOffIfStructuredLoggingIsEnabled() {
		ApplicationProperties properties = new ApplicationProperties();
		MockEnvironment environment = new MockEnvironment();
		environment.setProperty("logging.structured.format.console", "ecs");
		assertThat(properties.getBannerMode(environment)).isEqualTo(Mode.OFF);
	}

	@Test
	void shouldRegisterHints() {
		RuntimeHints hints = new RuntimeHints();
		new ApplicationPropertiesRuntimeHints().registerHints(hints, getClass().getClassLoader());
		assertThat(RuntimeHintsPredicates.reflection().onType(ApplicationProperties.class)).accepts(hints);
		assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(ApplicationProperties.class, "setBannerMode"))
			.accepts(hints);
		assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(ApplicationProperties.class, "getSources"))
			.accepts(hints);
		assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(ApplicationProperties.class, "setSources"))
			.accepts(hints);
		assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(ApplicationProperties.class, "getBannerMode"))
			.rejects(hints);
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free