Home / Class/ PrefixedIterableConfigurationPropertySourceTests Class — spring-boot Architecture

PrefixedIterableConfigurationPropertySourceTests Class — spring-boot Architecture

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

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/PrefixedIterableConfigurationPropertySourceTests.java lines 28–52

class PrefixedIterableConfigurationPropertySourceTests {

	@Test
	void streamShouldConsiderPrefix() {
		MockConfigurationPropertySource source = new MockConfigurationPropertySource();
		source.put("my.foo.bar", "bing");
		source.put("my.foo.baz", "biff");
		source.put("hello.bing", "blah");
		IterableConfigurationPropertySource prefixed = source.withPrefix("my");
		assertThat(prefixed.stream()).containsExactly(ConfigurationPropertyName.of("foo.bar"),
				ConfigurationPropertyName.of("foo.baz"), ConfigurationPropertyName.of("hello.bing"));
	}

	@Test
	void emptyPrefixShouldReturnOriginalStream() {
		MockConfigurationPropertySource source = new MockConfigurationPropertySource();
		source.put("my.foo.bar", "bing");
		source.put("my.foo.baz", "biff");
		source.put("hello.bing", "blah");
		IterableConfigurationPropertySource prefixed = source.withPrefix("");
		assertThat(prefixed.stream()).containsExactly(ConfigurationPropertyName.of("my.foo.bar"),
				ConfigurationPropertyName.of("my.foo.baz"), ConfigurationPropertyName.of("hello.bing"));
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free