Commit 7afde2ba authored by Phillip Webb's avatar Phillip Webb

Add another ConfigurationPropertyName.equals test

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

See gh-14665
parent 923e47e9
...@@ -582,6 +582,15 @@ public class ConfigurationPropertyNameTests { ...@@ -582,6 +582,15 @@ public class ConfigurationPropertyNameTests {
assertThat((Object) n14).isNotEqualTo(n15); 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 @Test
public void isValidWhenValidShouldReturnTrue() { public void isValidWhenValidShouldReturnTrue() {
assertThat(ConfigurationPropertyName.isValid("")).isTrue(); assertThat(ConfigurationPropertyName.isValid("")).isTrue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment