Source:
<code>public void testJDTCompiler() throws Exception { Path tmpRoot = Files.createTempDirectory("repo"); Path temp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); TestUtil.copyTree(Paths.get(ResourcesConstants.DUMMY_KIE_MULTIMODULE_UNTOUCHED_WITH_ERROR_DIR), temp); Path tmp = Paths.get(tmpRoot.toAbsolutePath().toString(), "dummy"); Path mainPom = Paths.get(tmp.toAbsolutePath().toString(), "pom.xml"); byte[] encoded = Files.readAllBytes(Paths.get(tmp.toAbsolutePath().toString(), "pom.xml")); <START> String pomAsAstring = new String(encoded, <END> StandardCharsets.UTF_8); assertThat(pomAsAstring).doesNotContain("<artifactId>kie-takari-lifecycle-plugin</artifactId>"); assertThat(pomAsAstring).doesNotContain("<packaging>kjar</packaging>"); assertThat(pomAsAstring).doesNotContain("<compilerId>jdt</compilerId>"); assertThat(pomAsAstring).doesNotContain("<source>1.8</source>"); assertThat(pomAsAstring).doesNotContain("<target>1.8</target>"); WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); CompilationRequest req = new DefaultCompilationRequest(mavenRepo.toAbsolutePath().toString(), info, new String[]{MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE}, Boolean.FALSE); DefaultIncrementalCompilerEnabler enabler = new DefaultIncrementalCompilerEnabler(); assertThat(enabler.process(req).getResult()).isTrue(); encoded = Files.readAllBytes(Paths.get(mainPom.toString())); pomAsAstring = new String(encoded, StandardCharsets.UTF_8); assertThat(pomAsAstring).contains("<compilerId>jdt</compilerId>"); assertThat(pomAsAstring).contains("<source>1.8</source>"); assertThat(pomAsAstring).contains("<target>1.8</target>"); TestUtil.rm(tmpRoot.toFile()); }</code><technical_language>In general chain multiple assertions object, in this case: assertThat(pomAsAstring) .doesNotContain("<artifactId>kie-takari-lifecycle-plugin</artifactId>") .doesNotContain("<packaging>kjar</packaging>") .doesNotContain("<compilerId>jdt</compilerId>") .doesNotContain("<source>1.8</source>") .doesNotContain("<target>1.8</target>");</technical_language>

Target:
public void testJDTCompiler() throws Exception { Path tmpRoot = Files.createTempDirectory("repo"); Path temp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); TestUtil.copyTree(Paths.get(ResourcesConstants.DUMMY_KIE_MULTIMODULE_UNTOUCHED_WITH_ERROR_DIR), temp); Path tmp = Paths.get(tmpRoot.toAbsolutePath().toString(), "dummy"); Path mainPom = Paths.get(tmp.toAbsolutePath().toString(), "pom.xml"); byte[] encoded = Files.readAllBytes(Paths.get(tmp.toAbsolutePath().toString(), "pom.xml")); String pomAsAstring = new String(encoded, StandardCharsets.UTF_8); assertThat(pomAsAstring).doesNotContain("<artifactId>kie-takari-lifecycle-plugin</artifactId>") .doesNotContain("<packaging>kjar</packaging>") .doesNotContain("<compilerId>jdt</compilerId>") .doesNotContain("<source>1.8</source>") .doesNotContain("<target>1.8</target>"); WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); CompilationRequest req = new DefaultCompilationRequest(mavenRepo.toAbsolutePath().toString(), info, new String[]{MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE}, Boolean.FALSE); DefaultIncrementalCompilerEnabler enabler = new DefaultIncrementalCompilerEnabler(); assertThat(enabler.process(req).getResult()).isTrue(); encoded = Files.readAllBytes(Paths.get(mainPom.toString())); pomAsAstring = new String(encoded, StandardCharsets.UTF_8); assertThat(pomAsAstring).contains("<compilerId>jdt</compilerId>") .contains("<source>1.8</source>") .contains("<target>1.8</target>"); TestUtil.rm(tmpRoot.toFile()); }