spring-boot
spring-boot copied to clipboard
IncrementalBuildMetadataGenerationTests#incrementalBuildTypeRenamed does not test what it's supposed to
MetadataItemCondition#matches(ConfigurationMetadata value)
uses the first metadata entry with the matching id. If there are more than one, this is ignored.
IncrementalBuildMetadataGenerationTests#incrementalBuildTypeRenamed
doesn't test that the metadata for the renamed pojo has been removed and it only works because the metadata for the new file is the first entry. While working on #26230, it turns out the order changes which revealed the inconsistency.
We should improve the assertion and find out if incremental compilation actually works when a type is renamed.
MetadataItemCondition#matches(ConfigurationMetadata value) uses the first metadata entry with the matching id. If there are more than one, this is ignored.
Actually, changing that code locally to fail if there are more than one matching item by name only fails this specific test.
A note that, as of 2.4.x
, the item duplication is no longer a problem as the merge algorithm has been improved. It remains that the test is still wrong as MetadataCollector#deletedInCurrentBuild
is never true
.