forked from objectionary/eo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 25 additions & 1 deletion
26
eo-maven-plugin/src/test/java/org/eolang/maven/DownloadJnaMojoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,40 @@ | ||
package org.eolang.maven; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
class DownloadJnaMojoTest { | ||
|
||
private static final Path OUT = Paths.get("target/classes"); | ||
|
||
private static final String JNA_JAR = "jna-5.14.0.jar"; | ||
|
||
@Test | ||
void executesWithoutErrors(@TempDir final Path temp) { | ||
Assertions.assertDoesNotThrow( | ||
() -> new FakeMaven(temp).execute(DownloadJnaMojo.class), | ||
"Exception shouldn't been thrown" | ||
); | ||
} | ||
} | ||
|
||
@Test | ||
void createsOutDir(@TempDir final Path temp) throws IOException { | ||
new FakeMaven(temp).execute(DownloadJnaMojo.class); | ||
Assertions.assertTrue( | ||
Files.exists(temp.resolve(OUT)) | ||
); | ||
} | ||
|
||
@Test | ||
void downloadsCorrectly(@TempDir final Path temp) throws IOException { | ||
new FakeMaven(temp).execute(DownloadJnaMojo.class); | ||
Assertions.assertTrue( | ||
Files.exists(temp.resolve(OUT).resolve(JNA_JAR)) | ||
); | ||
} | ||
} |