Skip to content

Commit 1e87ea3

Browse files
Bukamaslawekjaranowski
authored andcommitted
Fixed CleanMojoTest.java
1 parent c21ec13 commit 1e87ea3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/test/java/org/apache/maven/plugins/clean/CleanMojoTest.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Collections;
3131

3232
import org.apache.maven.plugin.MojoExecutionException;
33+
import org.apache.maven.plugin.logging.SystemStreamLog;
3334
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
3435

3536
import static org.apache.commons.io.FileUtils.copyDirectory;
@@ -273,6 +274,7 @@ public void testCleanLockedFileWithNoError() throws Exception {
273274

274275
/**
275276
* Test the followLink option with windows junctions
277+
*
276278
* @throws Exception
277279
*/
278280
public void testFollowLinksWithWindowsJunction() throws Exception {
@@ -298,6 +300,7 @@ public void testFollowLinksWithWindowsJunction() throws Exception {
298300

299301
/**
300302
* Test the followLink option with sym link
303+
*
301304
* @throws Exception
302305
*/
303306
public void testFollowLinksWithSymLinkOnPosix() throws Exception {
@@ -315,13 +318,9 @@ public void testFollowLinksWithSymLinkOnPosix() throws Exception {
315318
});
316319
}
317320

318-
@FunctionalInterface
319-
interface LinkCreator {
320-
void createLink(Path link, Path target) throws Exception;
321-
}
322-
323321
private void testSymlink(LinkCreator linkCreator) throws Exception {
324-
Cleaner cleaner = new Cleaner(null, null, false, null, null);
322+
// We use the SystemStreamLog() as the AbstractMojo class, because from there the Log is always provided
323+
Cleaner cleaner = new Cleaner(null, new SystemStreamLog(), false, null, null);
325324
Path testDir = Paths.get("target/test-classes/unit/test-dir").toAbsolutePath();
326325
Path dirWithLnk = testDir.resolve("dir");
327326
Path orgDir = testDir.resolve("org-dir");
@@ -371,4 +370,9 @@ private boolean checkEmpty(String dir) {
371370
File[] files = new File(dir).listFiles();
372371
return files == null || files.length == 0;
373372
}
373+
374+
@FunctionalInterface
375+
interface LinkCreator {
376+
void createLink(Path link, Path target) throws Exception;
377+
}
374378
}

0 commit comments

Comments
 (0)