From d1da0d0d200a8b64e9a6e764a30b953517729b63 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 4 Nov 2011 16:33:15 +0000 Subject: [PATCH] fix compilation issue due to redback upgrade git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1197635 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/archiva/DownloadArtifactsTest.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java index fe5a13732..b616d67bc 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java @@ -32,8 +32,8 @@ import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.transport.servlet.CXFServlet; import org.apache.maven.wagon.providers.http.HttpWagon; import org.apache.maven.wagon.repository.Repository; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.redback.integration.security.role.RedbackRoleConstants; +import org.codehaus.redback.rest.api.model.User; import org.codehaus.redback.rest.api.services.RoleManagementService; import org.codehaus.redback.rest.api.services.UserService; import org.codehaus.redback.rest.services.FakeCreateAdminService; @@ -58,11 +58,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.io.FileWriter; import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; @@ -183,10 +179,13 @@ public class DownloadArtifactsTest this.redirectPort = redirectServer.getConnectors()[0].getLocalPort(); log.info( "redirect server port {}", redirectPort ); - FakeCreateAdminService fakeCreateAdminService = getFakeCreateAdminService(); + User user = new User(); + user.setEmail( "toto@toto.fr" ); + user.setFullName( "the root user" ); + user.setUsername( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME ); + user.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD ); - Boolean res = fakeCreateAdminService.createAdminIfNeeded(); - assertTrue( res.booleanValue() ); + getUserService( null ).createAdminUser( user ); } @@ -223,7 +222,6 @@ public class DownloadArtifactsTest getUserService( authorizationHeader ).removeFromCache( "guest" ); - /* URL url = new URL( "http://localhost:" + port + "/repository/internal/junit/junit/4.9/junit-4.9.jar" ); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); -- 2.39.5