Home / Class/ CachingConfigurationPropertySourceTests Class — spring-boot Architecture

CachingConfigurationPropertySourceTests Class — spring-boot Architecture

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

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/CachingConfigurationPropertySourceTests.java lines 31–54

class CachingConfigurationPropertySourceTests {

	@Test
	void findWhenNullSourceReturnsNull() {
		ConfigurationPropertySource source = null;
		assertThat(CachingConfigurationPropertySource.find(source)).isNull();
	}

	@Test
	void findWhenNotCachingConfigurationPropertySourceReturnsNull() {
		ConfigurationPropertySource source = mock(ConfigurationPropertySource.class);
		assertThat(CachingConfigurationPropertySource.find(source)).isNull();
	}

	@Test
	void findWhenCachingConfigurationPropertySourceReturnsCaching() {
		ConfigurationPropertySource source = mock(ConfigurationPropertySource.class,
				withSettings().extraInterfaces(CachingConfigurationPropertySource.class));
		ConfigurationPropertyCaching caching = mock(ConfigurationPropertyCaching.class);
		given(((CachingConfigurationPropertySource) source).getCaching()).willReturn(caching);
		assertThat(CachingConfigurationPropertySource.find(source)).isEqualTo(caching);
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free