Home / Class/ AbstractApplicationEnvironmentTests Class — spring-boot Architecture

AbstractApplicationEnvironmentTests Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/testFixtures/java/org/springframework/boot/AbstractApplicationEnvironmentTests.java lines 36–67

public abstract class AbstractApplicationEnvironmentTests {

	@Test
	void getActiveProfilesDoesNotResolveProperty() {
		StandardEnvironment environment = createEnvironment();
		new MockPropertySource().withProperty("", "");
		environment.getPropertySources()
			.addFirst(new MockPropertySource().withProperty(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, "test"));
		assertThat(environment.getActiveProfiles()).isEmpty();
	}

	@Test
	void getDefaultProfilesDoesNotResolveProperty() {
		StandardEnvironment environment = createEnvironment();
		new MockPropertySource().withProperty("", "");
		environment.getPropertySources()
			.addFirst(
					new MockPropertySource().withProperty(AbstractEnvironment.DEFAULT_PROFILES_PROPERTY_NAME, "test"));
		assertThat(environment.getDefaultProfiles()).containsExactly("default");
	}

	@Test
	void propertyResolverIsOptimizedForConfigurationProperties() {
		StandardEnvironment environment = createEnvironment();
		ConfigurablePropertyResolver expected = ConfigurationPropertySources
			.createPropertyResolver(new MutablePropertySources());
		assertThat(environment).extracting("propertyResolver").hasSameClassAs(expected);
	}

	protected abstract StandardEnvironment createEnvironment();

}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free