mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.3.x'
Closes gh-23960
This commit is contained in:
commit
23e5fd798c
@ -111,7 +111,7 @@ public class MetadataCollector {
|
||||
}
|
||||
|
||||
private boolean deletedInCurrentBuild(String sourceType) {
|
||||
return this.processingEnvironment.getElementUtils().getTypeElement(sourceType) == null;
|
||||
return this.processingEnvironment.getElementUtils().getTypeElement(sourceType.replace('$', '.')) == null;
|
||||
}
|
||||
|
||||
private boolean processedInCurrentBuild(String sourceType) {
|
||||
|
@ -23,6 +23,7 @@ import org.springframework.boot.configurationprocessor.metadata.Metadata;
|
||||
import org.springframework.boot.configurationsample.incremental.BarProperties;
|
||||
import org.springframework.boot.configurationsample.incremental.FooProperties;
|
||||
import org.springframework.boot.configurationsample.incremental.RenamedBarProperties;
|
||||
import org.springframework.boot.configurationsample.simple.ClassWithNestedProperties;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@ -92,4 +93,12 @@ class IncrementalBuildMetadataGenerationTests extends AbstractMetadataGeneration
|
||||
.has(Metadata.withProperty("bar.counter").withDefaultValue(0).fromSource(RenamedBarProperties.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void incrementalBuildDoesNotDeleteItems() throws Exception {
|
||||
TestProject project = new TestProject(this.tempDir, ClassWithNestedProperties.class, FooProperties.class);
|
||||
ConfigurationMetadata initialMetadata = project.fullBuild();
|
||||
ConfigurationMetadata updatedMetadata = project.incrementalBuild(FooProperties.class);
|
||||
assertThat(initialMetadata.getItems()).isEqualTo(updatedMetadata.getItems());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user