Add another ConfigurationPropertyName.equals test

Include an additional test to ensure that `.equals` works for names
starting with the same value.

See gh-14665
This commit is contained in:
Phillip Webb
2018-10-02 13:58:31 -07:00
parent 923e47e978
commit 7afde2ba43

View File

@@ -582,6 +582,15 @@ public class ConfigurationPropertyNameTests {
assertThat((Object) n14).isNotEqualTo(n15);
}
@Test
public void equalsWhenStartsWith() {
// gh-14665
ConfigurationPropertyName n1 = ConfigurationPropertyName.of("my.sources[0].xame");
ConfigurationPropertyName n2 = ConfigurationPropertyName
.of("my.sources[0].xamespace");
assertThat(n1).isNotEqualTo(n2);
}
@Test
public void isValidWhenValidShouldReturnTrue() {
assertThat(ConfigurationPropertyName.isValid("")).isTrue();