Home / Class/ WebPropertiesResourcesBindingTests Class — spring-boot Architecture

WebPropertiesResourcesBindingTests Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebPropertiesResourcesBindingTests.java lines 37–69

class WebPropertiesResourcesBindingTests {

	private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
		.withUserConfiguration(TestConfiguration.class);

	@Test
	void staticLocationsExpandArray() {
		this.contextRunner
			.withPropertyValues("spring.web.resources.static-locations[0]=classpath:/one/",
					"spring.web.resources.static-locations[1]=classpath:/two",
					"spring.web.resources.static-locations[2]=classpath:/three/",
					"spring.web.resources.static-locations[3]=classpath:/four",
					"spring.web.resources.static-locations[4]=classpath:/five/",
					"spring.web.resources.static-locations[5]=classpath:/six")
			.run(assertResourceProperties((properties) -> assertThat(properties.getStaticLocations()).contains(
					"classpath:/one/", "classpath:/two/", "classpath:/three/", "classpath:/four/", "classpath:/five/",
					"classpath:/six/")));
	}

	private ContextConsumer<AssertableApplicationContext> assertResourceProperties(Consumer<Resources> consumer) {
		return (context) -> {
			assertThat(context).hasSingleBean(WebProperties.class);
			consumer.accept(context.getBean(WebProperties.class).getResources());
		};
	}

	@Configuration(proxyBeanMethods = false)
	@EnableConfigurationProperties(WebProperties.class)
	static class TestConfiguration {

	}

}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free