### Question:
OutputLogAfterDecorator implements CompilerDecorator { @Override public T compile(CompilationRequest req) { T res = compiler.compile(req); return handleMavenOutput(req, res); } OutputLogAfterDecorator(C compiler); C getCompiler(); @Override T compile(CompilationRequest req); @Override CompilationResponse compile(CompilationRequest req, Map override); @Override Boolean cleanInternalCache();  }### Answer:
@Test public void compileTest() { CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath}, Boolean.FALSE); OutputLogAfterDecorator decorator = new OutputLogAfterDecorator(new BaseMavenCompiler(true,true)); CompilationResponse res = decorator.compile(req); SoftAssertions.assertSoftly(softly -> { softly.assertThat(res.isSuccessful()).isTrue(); softly.assertThat(res.getMavenOutput().size()).isGreaterThan(0); }); }
@Test public void compileWithOverrideTest() throws Exception { Map<Path, InputStream> override = new HashMap<>(); org.uberfire.java.nio.file.Path path = org.uberfire.java.nio.file.Paths.get(tmpRoot + "/src/main/java/dummy/DummyOverride.java"); InputStream input = new FileInputStream(new File(ResourcesConstants.DUMMY_OVERRIDE + "/src/main/java/dummy/DummyOverride.java")); override.put(path, input); CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath}, Boolean.FALSE); OutputLogAfterDecorator decorator = new OutputLogAfterDecorator(new BaseMavenCompiler(true,true)); CompilationResponse res = decorator.compile(req, override); SoftAssertions.assertSoftly(softly -> { softly.assertThat(res.isSuccessful()).isTrue(); softly.assertThat(res.getMavenOutput().size()).isGreaterThan(0); }); }
@Test public void compileFailedTest() throws Exception { CompilationRequest req = new DefaultCompilationRequest(mavenRepoPath, createdNewPrjInRepo("dummy-fail", ResourcesConstants.DUMMY_FAIL_DEPS_SIMPLE), new String[]{MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath}, Boolean.FALSE); OutputLogAfterDecorator decorator = new OutputLogAfterDecorator(new BaseMavenCompiler(true,true)); CompilationResponse res = decorator.compile(req); SoftAssertions.assertSoftly(softly -> { softly.assertThat(res.isSuccessful()).isFalse(); softly.assertThat(res.getMavenOutput().size()).isGreaterThan(0); }); }