Home / Class/ ItemHintTests Class — spring-boot Architecture

ItemHintTests Class — spring-boot Architecture

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

Entity Profile

Source Code

configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/ItemHintTests.java lines 35–69

class ItemHintTests {

	@Test
	void prefixIsAppliedWithValueHint() {
		ValueHint firstValueHint = new ValueHint("one", "First.");
		ValueHint secondValueHint = new ValueHint("two", "Second.");
		ItemHint itemHint = new ItemHint("name", List.of(firstValueHint, secondValueHint), Collections.emptyList());
		ItemHint prefixedItemHint = itemHint.applyPrefix("example");
		assertThat(itemHint).isNotSameAs(prefixedItemHint);
		assertThat(prefixedItemHint.getName()).isEqualTo("example.name");
		assertThat(prefixedItemHint.getValues()).containsExactly(firstValueHint, secondValueHint);
		assertThat(prefixedItemHint.getProviders()).isEmpty();
	}

	@Test
	void prefixIsAppliedWithValueProvider() {
		ValueProvider firstValueProvider = new ValueProvider("class-reference", Map.of("target", String.class));
		ValueProvider secondValueProvider = new ValueProvider("any", Collections.emptyMap());
		ItemHint itemHint = new ItemHint("name", Collections.emptyList(),
				List.of(firstValueProvider, secondValueProvider));
		ItemHint prefixedItemHint = itemHint.applyPrefix("example");
		assertThat(itemHint).isNotSameAs(prefixedItemHint);
		assertThat(prefixedItemHint.getName()).isEqualTo("example.name");
		assertThat(prefixedItemHint.getValues()).isEmpty();
		assertThat(prefixedItemHint.getProviders()).containsExactly(firstValueProvider, secondValueProvider);
	}

	@Test
	void prefixIsAppliedWithConvention() {
		ItemHint itemHint = new ItemHint("name", Collections.emptyList(), Collections.emptyList());
		ItemHint prefixedItemHint = itemHint.applyPrefix("example.nestedType");
		assertThat(prefixedItemHint.getName()).isEqualTo("example.nested-type.name");
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free