@Test public void incrementalBuildTypeRenamed() throws Exception { TestProject project = new TestProject(this.temporaryFolder, FooProperties.class, BarProperties.class); ConfigurationMetadata metadata = project.fullBuild(); assertThat(metadata).has( Metadata.withProperty("foo.counter").fromSource(FooProperties.class)); assertThat(metadata).has( Metadata.withProperty("bar.counter").fromSource(BarProperties.class)); assertThat(metadata).doesNotHave(Metadata.withProperty("bar.counter") .fromSource(RenamedBarProperties.class)); project.delete(BarProperties.class); project.add(RenamedBarProperties.class); metadata = project.incrementalBuild(RenamedBarProperties.class); assertThat(metadata).has( Metadata.withProperty("foo.counter").fromSource(FooProperties.class)); assertThat(metadata).doesNotHave( Metadata.withProperty("bar.counter").fromSource(BarProperties.class)); assertThat(metadata).has(Metadata.withProperty("bar.counter") .fromSource(RenamedBarProperties.class)); }
@Test public void incrementalBuildTypeRenamed() throws Exception { TestProject project = new TestProject(this.temporaryFolder, FooProperties.class, BarProperties.class); ConfigurationMetadata metadata = project.fullBuild(); assertThat(metadata, containsProperty("foo.counter").fromSource(FooProperties.class)); assertThat(metadata, containsProperty("bar.counter").fromSource(BarProperties.class)); assertThat(metadata, not( containsProperty("bar.counter").fromSource(RenamedBarProperties.class))); project.delete(BarProperties.class); project.add(RenamedBarProperties.class); metadata = project.incrementalBuild(RenamedBarProperties.class); assertThat(metadata, containsProperty("foo.counter").fromSource(FooProperties.class)); assertThat(metadata, not(containsProperty("bar.counter").fromSource(BarProperties.class))); assertThat(metadata, containsProperty("bar.counter").fromSource(RenamedBarProperties.class)); }