From 4ce3140da9230710007669765f9579f0bd76cd82 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 1 Oct 2015 16:13:29 +1000 Subject: [PATCH] fix issue when using proxy --- archiva-modules/archiva-base/archiva-proxy/pom.xml | 7 +++++++ .../org/apache/archiva/proxy/HttpProxyTransferTest.java | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index 83e0ce068..7abec4839 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -204,6 +204,11 @@ xercesImpl test + + org.assertj + assertj-core + test + @@ -260,6 +265,8 @@ ${redbackTestJdbcUrl} ${redbackTestJdbcDriver} mock + + diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java index b96a261ed..f0ca4f596 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java @@ -36,6 +36,7 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.repository.ManagedRepositoryContent; +import org.assertj.core.api.Assertions; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; @@ -199,8 +200,8 @@ public class HttpProxyTransferTest public void testGetOverHttpProxy() throws Exception { - assertNull( System.getProperty( "http.proxyHost" ) ); - assertNull( System.getProperty( "http.proxyPort" ) ); + Assertions.assertThat( System.getProperty( "http.proxyHost" ) ).isEmpty(); + Assertions.assertThat( System.getProperty( "http.proxyPort" ) ).isEmpty(); String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; @@ -226,8 +227,8 @@ public class HttpProxyTransferTest String actualContents = FileUtils.readFileToString( downloadedFile, Charset.defaultCharset() ); assertEquals( "Check file contents.", expectedContents, actualContents ); - assertNull( System.getProperty( "http.proxyHost" ) ); - assertNull( System.getProperty( "http.proxyPort" ) ); + Assertions.assertThat( System.getProperty( "http.proxyHost" ) ).isEmpty(); + Assertions.assertThat( System.getProperty( "http.proxyPort" ) ).isEmpty(); } private void addConnector() -- 2.39.5