]> source.dussan.org Git - archiva.git/commitdiff
fix issue when using proxy
authorOlivier Lamy <olamy@apache.org>
Thu, 1 Oct 2015 06:13:29 +0000 (16:13 +1000)
committerOlivier Lamy <olamy@apache.org>
Thu, 1 Oct 2015 06:13:29 +0000 (16:13 +1000)
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java

index 83e0ce0686ed94e44e336bc215e68c98dc748ec8..7abec48394dbd576e1136980a8f7290dddc7340e 100644 (file)
       <artifactId>xercesImpl</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
             <redback.jdbc.url>${redbackTestJdbcUrl}</redback.jdbc.url>
             <redback.jdbc.driver.name>${redbackTestJdbcDriver}</redback.jdbc.driver.name>
             <archiva.repositorySessionFactory.id>mock</archiva.repositorySessionFactory.id>
+            <http.proxyHost></http.proxyHost>
+            <http.proxyPort></http.proxyPort>
           </systemPropertyVariables>
         </configuration>
       </plugin>
index b96a261ed00955359312cb1e46ffc5cae1ef266a..f0ca4f596ab9db422163680443c1570db36fc7c2 100644 (file)
@@ -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()