diff --git a/src/test/java/org/codehaus/mojo/wagon/Wagon334MojoHttpIT.java b/src/test/java/org/codehaus/mojo/wagon/Wagon334MojoHttpIT.java
index a91a916..091b885 100644
--- a/src/test/java/org/codehaus/mojo/wagon/Wagon334MojoHttpIT.java
+++ b/src/test/java/org/codehaus/mojo/wagon/Wagon334MojoHttpIT.java
@@ -2,7 +2,10 @@
import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -17,17 +20,21 @@
@RunWith( MavenJUnitTestRunner.class )
@MavenVersions( { "3.6.3" } )
-public class Wagon334MojoHttpIT
+public class Wagon334MojoHttpIT extends AbstractJettyIT
{
@Rule
public final TestResources resources = new TestResources();
- public final MavenRuntime maven;
+ private final MavenRuntimeBuilder mavenBuilder;
+ public MavenRuntime maven;
- public Wagon334MojoHttpIT(MavenRuntimeBuilder builder )
- throws Exception
- {
- this.maven = builder.withCliOptions( "-B" ).build();
+ public Wagon334MojoHttpIT(MavenRuntimeBuilder builder ) {
+ this.mavenBuilder = builder.withCliOptions( "-B" );
+ }
+
+ @Before
+ public void setPort() throws Exception {
+ this.maven = this.mavenBuilder.withCliOptions( "-Dserver.port=" + getServerPort() ).build();
}
@Test
@@ -46,4 +53,10 @@ public void testDownload()
Assert.assertTrue( new File(downloadDir, "commons-dbutils-1.2-bin.tar.gz.asc.md5" ).exists() );
Assert.assertTrue( new File(downloadDir, "commons-dbutils-1.2-bin.tar.gz.asc.sha1" ).exists() );
}
+
+ @Override
+ protected Path getDirectoryToServe() throws IOException {
+ return resources.getBasedir("http-download-02").toPath()
+ .resolve("files");
+ }
}
diff --git a/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc
new file mode 100644
index 0000000..c6cac69
--- /dev/null
+++ b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc
@@ -0,0 +1 @@
+empty
diff --git a/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.md5 b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.md5
new file mode 100644
index 0000000..c6cac69
--- /dev/null
+++ b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.md5
@@ -0,0 +1 @@
+empty
diff --git a/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.sha1 b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.sha1
new file mode 100644
index 0000000..c6cac69
--- /dev/null
+++ b/src/test/projects/http-download-02/files/maven2/commons-dbutils/commons-dbutils/1.2/commons-dbutils-1.2-bin.tar.gz.asc.sha1
@@ -0,0 +1 @@
+empty
diff --git a/src/test/projects/http-download-02/pom.xml b/src/test/projects/http-download-02/pom.xml
index cdece8f..830b689 100644
--- a/src/test/projects/http-download-02/pom.xml
+++ b/src/test/projects/http-download-02/pom.xml
@@ -10,6 +10,7 @@
${project.build.directory}/it/http-download
3.3.4
+ 8080
@@ -40,7 +41,7 @@
download
- https://repo1.maven.org/maven2/commons-dbutils/commons-dbutils/1.2
+ http://localhost:${server.port}/maven2/commons-dbutils/commons-dbutils/1.2
commons-dbutils-1.2-bin.tar.gz.asc,
commons-dbutils-1.2-bin.tar.gz.asc.md5,
@@ -53,4 +54,4 @@
-
\ No newline at end of file
+