Home / Function/ analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() — spring-boot Function Reference

analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() — spring-boot Function Reference

Architecture documentation for the analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() function in MutuallyExclusiveConfigurationPropertiesFailureAnalyzerTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75["analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis()"]
  ab6b1ce0_a57f_aa56_2dd9_2b936525a899["get()"]
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75 -->|calls| ab6b1ce0_a57f_aa56_2dd9_2b936525a899
  2c630fd5_2829_3c98_d0b7_a054bda08e33["MutuallyExclusiveConfigurationPropertiesException()"]
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75 -->|calls| 2c630fd5_2829_3c98_d0b7_a054bda08e33
  e638bb1b_7ade_7a52_c1d0_1018847097bf["performAnalysis()"]
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75 -->|calls| e638bb1b_7ade_7a52_c1d0_1018847097bf
  1a4e5320_a2e2_8aa5_7d05_1e805db190f1["getAction()"]
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75 -->|calls| 1a4e5320_a2e2_8aa5_7d05_1e805db190f1
  ebc7cdd4_21bc_3491_686c_090da262ca48["getDescription()"]
  7d6c4a4e_aa77_218a_06d0_5396cfe14b75 -->|calls| ebc7cdd4_21bc_3491_686c_090da262ca48
  style 7d6c4a4e_aa77_218a_06d0_5396cfe14b75 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/MutuallyExclusiveConfigurationPropertiesFailureAnalyzerTests.java lines 92–116

	@Test
	void analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() {
		Map<String, Object> properties = new LinkedHashMap<>();
		properties.put("com.example.a", "alpha");
		properties.put("com.example.b", "bravo");
		this.environment.getPropertySources()
			.addFirst(OriginCapablePropertySource.get(new MapPropertySource("test-one", properties)));
		this.environment.getPropertySources()
			.addLast(OriginCapablePropertySource.get(new MapPropertySource("test-two", properties)));
		MutuallyExclusiveConfigurationPropertiesException failure = new MutuallyExclusiveConfigurationPropertiesException(
				new HashSet<>(Arrays.asList("com.example.a", "com.example.b")),
				new HashSet<>(Arrays.asList("com.example.a", "com.example.b")));
		FailureAnalysis analysis = performAnalysis(failure);
		assertThat(analysis).isNotNull();
		assertThat(analysis.getAction()).isEqualTo(
				"Update your configuration so that only one of the mutually exclusive properties is configured.");
		assertThat(analysis.getDescription()).contains(String.format(
				"The following configuration properties are mutually exclusive:%n%n\tcom.example.a%n\tcom.example.b%n"))
			.contains(
					String.format("However, more than one of those properties has been configured at the same time:%n%n"
							+ "\tcom.example.a (originating from 'TestOrigin test-one')%n"
							+ "\tcom.example.a (originating from 'TestOrigin test-two')%n"
							+ "\tcom.example.b (originating from 'TestOrigin test-one')%n"
							+ "\tcom.example.b (originating from 'TestOrigin test-two')%n"));
	}

Domain

Subdomains

Frequently Asked Questions

What does analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() do?
analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() is a function in the spring-boot codebase.
What does analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() call?
analyzeWhenPropertyIsInMultiplePropertySourcesShouldListEachSourceInAnalysis() calls 5 function(s): MutuallyExclusiveConfigurationPropertiesException, get, getAction, getDescription, performAnalysis.

Analyze Your Own Codebase

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

Try Supermodel Free