ConfigurationPropertyStateTests Class — spring-boot Architecture
Architecture documentation for the ConfigurationPropertyStateTests class in ConfigurationPropertyStateTests.java from the spring-boot codebase.
Entity Profile
Source Code
core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyStateTests.java lines 33–64
class ConfigurationPropertyStateTests {
@Test
@SuppressWarnings("NullAway") // Test null check
void searchWhenIterableIsNullShouldThrowException() {
assertThatIllegalArgumentException().isThrownBy(() -> ConfigurationPropertyState.search(null, (e) -> true))
.withMessageContaining("'source' must not be null");
}
@Test
@SuppressWarnings("NullAway") // Test null check
void searchWhenPredicateIsNullShouldThrowException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> ConfigurationPropertyState.search(Collections.emptyList(), null))
.withMessageContaining("'predicate' must not be null");
}
@Test
void searchWhenContainsItemShouldReturnPresent() {
List<String> source = Arrays.asList("a", "b", "c");
ConfigurationPropertyState result = ConfigurationPropertyState.search(source, "b"::equals);
assertThat(result).isEqualTo(ConfigurationPropertyState.PRESENT);
}
@Test
void searchWhenContainsNoItemShouldReturnAbsent() {
List<String> source = Arrays.asList("a", "x", "c");
ConfigurationPropertyState result = ConfigurationPropertyState.search(source, "b"::equals);
assertThat(result).isEqualTo(ConfigurationPropertyState.ABSENT);
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free