@Test
public void testGetOrdinal() {

    PropertySource defaultPropertySource = new BasePropertySource(56) {
        @Override
        public String getName() {
            return "testWithDefault";
        }
        @Override
        public PropertyValue get(String key) {
            return null;
        }
        @Override
        public Map<String, PropertyValue> getProperties() {
            return Collections.emptyMap();
        }
    };
    assertThat(PropertySourceComparator.getOrdinal(defaultPropertySource)).isEqualTo(56);
    assertThat(new OverriddenOrdinalPropertySource().getOrdinal()).isEqualTo(1000);
    // propertySource with invalid ordinal
    assertThat(new OverriddenInvalidOrdinalPropertySource().getOrdinal()).isEqualTo(1);
}