spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

IncrementalBuildMetadataGenerationTests#incrementalBuildTypeRenamed does not test what it's supposed to

Open snicoll opened this issue 3 years ago • 2 comments

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.

snicoll avatar Apr 28 '21 11:04 snicoll

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.

snicoll avatar Apr 28 '21 11:04 snicoll

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.

snicoll avatar Apr 28 '21 12:04 snicoll