Skip to content

Commit

Permalink
fix(#2729): fake maven in all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Dec 28, 2023
1 parent d16e9e1 commit 6ec2c89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import org.cactoos.set.SetOf;
import org.eolang.maven.hash.CommitHashesMap;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
Expand All @@ -50,9 +51,9 @@ void cleansSuccessfully(@TempDir final Path temp) throws IOException {
if (!small.toFile().exists() || !file.toFile().exists()) {
throw new IllegalStateException("Files not created.");
}
new Moja<>(CleanMojo.class)
new FakeMaven(temp)
.with("targetDir", dir.toFile())
.execute();
.execute(CleanMojo.class);
MatcherAssert.assertThat(
!file.toFile().exists() && !small.toFile().exists(),
Matchers.is(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import org.cactoos.text.TextOf;
import org.eolang.maven.hash.CommitHashesMap;
import org.eolang.maven.util.HmBase;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
Expand All @@ -49,12 +50,12 @@ void copiesSources(@TempDir final Path temp) throws Exception {
Paths.get("foo/main.eo")
);
final String ver = "1.1.1";
new Moja<>(CopyMojo.class)
new FakeMaven(temp)
.with("sourcesDir", src.toFile())
.with("outputDir", classes.toFile())
.with("skip", false)
.with("version", ver)
.execute();
.execute(CopyMojo.class);
final Path out = classes.resolve("EO-SOURCES/foo/main.eo");
MatcherAssert.assertThat(
new HmBase(classes).exists(classes.relativize(out)),
Expand Down

0 comments on commit 6ec2c89

Please sign in to comment.