summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-webdav/src
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-25 06:29:30 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-25 06:29:30 +0000
commit7156611df05dc611ea030e74358730f1f1273dbb (patch)
treedb4c5d47f45fd97c95c22ff94415b4a613ce04b1 /archiva-modules/archiva-web/archiva-webdav/src
parent306610e85332ed6f22e3e86f9fd51b84d62479ef (diff)
downloadarchiva-7156611df05dc611ea030e74358730f1f1273dbb.tar.gz
archiva-7156611df05dc611ea030e74358730f1f1273dbb.zip
use assertj as fest-assert is not maintained anymore
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1581256 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webdav/src')
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletBrowseTest.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java39
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java5
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/RepositoryPathUtilTest.java6
5 files changed, 23 insertions, 35 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java
index 0da0394af..c38e33f54 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java
@@ -36,7 +36,7 @@ import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
-import org.fest.assertions.api.Assertions;
+import static org.assertj.core.api.Assertions.assertThat;
import org.junit.After;
import org.junit.Before;
@@ -167,7 +167,7 @@ public abstract class AbstractRepositoryServletProxiedTestCase
WebClient client = newClient();
int status = client.getPage( remoteRepo.url ).getWebResponse().getStatusCode();
- Assertions.assertThat( status ).isEqualTo( HttpServletResponse.SC_OK );
+ assertThat( status ).isEqualTo( HttpServletResponse.SC_OK );
}
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletBrowseTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletBrowseTest.java
index 55228453f..6caa0e857 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletBrowseTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletBrowseTest.java
@@ -22,7 +22,7 @@ package org.apache.archiva.webdav;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
-import org.fest.assertions.api.Assertions;
+import static org.assertj.core.api.Assertions.assertThat;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@@ -119,7 +119,7 @@ public class RepositoryServletBrowseTest
private void assertLinks( List<String> expectedLinks, Elements actualLinks )
{
- Assertions.assertThat( actualLinks ).hasSize( expectedLinks.size() );
+ assertThat( actualLinks ).hasSize( expectedLinks.size() );
for ( int i = 0; i < actualLinks.size(); i++ )
{
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
index 0af1647af..5911c4d4a 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
@@ -28,7 +28,7 @@ import org.apache.archiva.configuration.RepositoryGroupConfiguration;
import org.apache.archiva.maven2.metadata.MavenMetadataReader;
import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.apache.commons.io.FileUtils;
-import org.fest.assertions.api.Assertions;
+import static org.assertj.core.api.Assertions.assertThat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -157,8 +157,7 @@ public class RepositoryServletRepositoryGroupTest
WebResponse response = getServletUnitClient().getResponse( request );
assertResponseOK( response );
- Assertions.assertThat( response.getContentAsString() ).isEqualTo( "first" );
- //assertEquals( "Expected file contents", "first", response.getContentAsString() );
+ assertThat( response.getContentAsString() ).isEqualTo( "first" );
}
/*
@@ -179,8 +178,8 @@ public class RepositoryServletRepositoryGroupTest
WebResponse response = getServletUnitClient().getResponse( request );
assertResponseOK( response );
- //assertEquals( "Expected file contents", "last", response.getContentAsString() );
- Assertions.assertThat( response.getContentAsString() ).isEqualTo( "last" );
+
+ assertThat( response.getContentAsString() ).isEqualTo( "last" );
}
/*
@@ -268,15 +267,8 @@ public class RepositoryServletRepositoryGroupTest
ArchivaRepositoryMetadata metadata = MavenMetadataReader.read( returnedMetadata );
assertResponseOK( response );
- /*
- assertEquals( "Versions list size", 4, metadata.getAvailableVersions().size() );
- assertTrue( "Versions list contains version 1.0", metadata.getAvailableVersions().contains( "1.0" ) );
- assertTrue( "Versions list contains version 1.5", metadata.getAvailableVersions().contains( "1.5" ) );
- assertTrue( "Versions list contains version 2.0", metadata.getAvailableVersions().contains( "2.0" ) );
- assertTrue( "Versions list contains version 2.5", metadata.getAvailableVersions().contains( "2.5" ) );
- */
-
- Assertions.assertThat( metadata.getAvailableVersions() ).isNotNull()
+
+ assertThat( metadata.getAvailableVersions() ).isNotNull()
.hasSize( 4 ).contains( "1.0", "1.5", "2.0", "2.5" );
@@ -295,10 +287,8 @@ public class RepositoryServletRepositoryGroupTest
response = getServletUnitClient().getResource( request );
assertResponseOK( response );
- //assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998 maven-metadata-group-with-valid-repos.xml",
- // response.getContentAsString() );
- Assertions.assertThat( response.getContentAsString() )
+ assertThat( response.getContentAsString() )
.isEqualTo( "add113b0d7f8c6adb92a5015a7a3701081edf998 maven-metadata-group-with-valid-repos.xml" );
// request the md5 checksum of the metadata
@@ -307,10 +297,8 @@ public class RepositoryServletRepositoryGroupTest
response = getServletUnitClient().getResource( request );
assertResponseOK( response );
- //assertEquals( "5b85ea4aa5f52bb76760041a52f98de8 maven-metadata-group-with-valid-repos.xml",
- // response.getContentAsString().trim() );
- Assertions.assertThat( response.getContentAsString() )
+ assertThat( response.getContentAsString() )
.isEqualTo( "5b85ea4aa5f52bb76760041a52f98de8 maven-metadata-group-with-valid-repos.xml" );
}
@@ -337,7 +325,7 @@ public class RepositoryServletRepositoryGroupTest
assertResponseOK( response );
- Assertions.assertThat( response.getContentAsString() ).contains( "Collection" )
+ assertThat( response.getContentAsString() ).contains( "Collection" )
.contains( "dummy/dummy-artifact" )
.contains( "1.0" )
.contains( "2.0" );
@@ -346,11 +334,10 @@ public class RepositoryServletRepositoryGroupTest
protected void assertResponseMethodNotAllowed( WebResponse response )
{
- //assertNotNull( "Should have recieved a response", response );
- Assertions.assertThat( response ).isNotNull();
- //assertEquals( "Should have been an 405/Method Not Allowed response code.",
- // HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getResponseCode() );
- Assertions.assertThat( response.getStatusCode() ).isEqualTo( HttpServletResponse.SC_METHOD_NOT_ALLOWED );
+
+ assertThat( response ).isNotNull();
+
+ assertThat( response.getStatusCode() ).isEqualTo( HttpServletResponse.SC_METHOD_NOT_ALLOWED );
}
protected RepositoryGroupConfiguration createRepositoryGroup( String id, List<String> repositories )
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java
index 691bfacf7..df35cdbc9 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java
@@ -25,12 +25,13 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.fest.assertions.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* RepositoryServletTest
*/
@@ -133,7 +134,7 @@ public class RepositoryServletTest
WebRequest request = new GetMethodWebRequest( path );
WebResponse response = getServletUnitClient().getResponse( request );
assertResponseNotFound( response );
- Assertions.assertThat( response.getContentAsString() ).contains(
+ assertThat( response.getContentAsString() ).contains(
"Invalid path to Artifact: legacy paths should have an expected type ending in [s] in the second part of the path." );
}
}
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/RepositoryPathUtilTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/RepositoryPathUtilTest.java
index 9567f0b36..564ae0ce6 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/RepositoryPathUtilTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/RepositoryPathUtilTest.java
@@ -21,9 +21,9 @@ package org.apache.archiva.webdav.util;
import junit.framework.TestCase;
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.fest.assertions.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
+import static org.assertj.core.api.Assertions.assertThat;
/**
*/
@@ -35,10 +35,10 @@ public class RepositoryPathUtilTest
public void testGetRepositoryId()
{
String href = "/path/to/my/resource";
- Assertions.assertThat( RepositoryPathUtil.getRepositoryName( href ) ).isEqualTo( "to" );
+ assertThat( RepositoryPathUtil.getRepositoryName( href ) ).isEqualTo( "to" );
href = "path/to/my/resource";
- Assertions.assertThat( RepositoryPathUtil.getRepositoryName( href ) ).isEqualTo( "to" );
+ assertThat( RepositoryPathUtil.getRepositoryName( href ) ).isEqualTo( "to" );
}