void () { compileModules("project.main"); clearOutputs(); compileModules("project.test"); if (isGradleNewerOrSameAs("7.1")) { assertThat(dirtyOutputRoots).as("Dirty output roots").containsExactlyInAnyOrder("build/tmp/compileTestJava/previous-compilation-data.bin"); } else { assertThat(dirtyOutputRoots).as("Dirty output roots").isEmpty(); } assertThat(generatedFiles).as("Generated files").containsOnly( Map.entry(testRoot, Set.of("my/pack/AppTest.class")) ); assertCopied(testRoot + "/my/pack/AppTest.class"); assertNotCopied(apiTestRoot + "/my/pack/ApiTest.class"); assertNotCopied(implTestRoot + "/my/pack/ImplTest.class"); }