Home / Class/ SpringApplicationBannerPrinterTests Class — spring-boot Architecture

SpringApplicationBannerPrinterTests Class — spring-boot Architecture

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

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationBannerPrinterTests.java lines 40–64

class SpringApplicationBannerPrinterTests {

	@Test
	void shouldRegisterRuntimeHints() {
		RuntimeHints runtimeHints = new RuntimeHints();
		new SpringApplicationBannerPrinter.SpringApplicationBannerPrinterRuntimeHints().registerHints(runtimeHints,
				getClass().getClassLoader());
		assertThat(RuntimeHintsPredicates.resource().forResource("banner.txt")).accepts(runtimeHints);
	}

	@Test
	@WithResource(name = "banner.txt", content = "\uD83D\uDE0D Spring Boot! \uD83D\uDE0D")
	void shouldUseUtf8() {
		ResourceLoader resourceLoader = new GenericApplicationContext();
		Resource resource = resourceLoader.getResource("classpath:banner.txt");
		SpringApplicationBannerPrinter printer = new SpringApplicationBannerPrinter(resourceLoader,
				new ResourceBanner(resource));
		Log log = mock(Log.class);
		printer.print(new MockEnvironment(), SpringApplicationBannerPrinterTests.class, log);
		ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
		then(log).should().info(captor.capture());
		assertThat(captor.getValue()).isEqualToIgnoringNewLines("\uD83D\uDE0D Spring Boot! \uD83D\uDE0D");
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free