From 338c198dc0793e579dde5d81163027e2105e1407 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Mon, 13 Jul 2020 15:00:51 +0200 Subject: [PATCH] Switching to central admin credentials for tests --- .../apache/archiva/remotedownload/AbstractDownloadTest.java | 5 +++-- .../DownloadMergedIndexNonDefaultPathTest.java | 3 ++- .../archiva/remotedownload/DownloadMergedIndexTest.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java index fb0f2d667..34a93d15e 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java @@ -24,6 +24,7 @@ import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants import org.apache.archiva.redback.rest.api.model.User; import org.apache.archiva.redback.rest.api.services.RoleManagementService; import org.apache.archiva.redback.rest.api.services.UserService; +import org.apache.archiva.redback.rest.services.BaseSetup; import org.apache.archiva.redback.rest.services.FakeCreateAdminService; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; import org.apache.archiva.rest.api.services.ProxyConnectorService; @@ -130,7 +131,7 @@ public abstract class AbstractDownloadTest String adminPwdSysProps = System.getProperty( "rest.admin.pwd" ); if ( StringUtils.isBlank( adminPwdSysProps ) ) { - return encode( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, FakeCreateAdminService.ADMIN_TEST_PWD ); + return encode( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, BaseSetup.getAdminPwd() ); } return encode( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, adminPwdSysProps ); } @@ -176,7 +177,7 @@ public abstract class AbstractDownloadTest user.setEmail( "toto@toto.fr" ); user.setFullName( "the root user" ); user.setUsername( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME ); - user.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD ); + user.setPassword( BaseSetup.getAdminPwd() ); getUserService( null ).createAdminUser( user ); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java index a0d5ff3d1..d7e25900e 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java @@ -24,6 +24,7 @@ import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants; +import org.apache.archiva.redback.rest.services.BaseSetup; import org.apache.archiva.redback.rest.services.FakeCreateAdminService; import org.apache.archiva.rest.api.model.SearchRequest; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; @@ -196,7 +197,7 @@ public class DownloadMergedIndexNonDefaultPathTest remoteRepository.setUrl( "http://localhost:" + port + "/repository/test-group" ); remoteRepository.setRemoteIndexUrl( "http://localhost:" + port + "/repository/test-group/" + path ); remoteRepository.setUserName( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME ); - remoteRepository.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD ); + remoteRepository.setPassword( BaseSetup.getAdminPwd() ); getRemoteRepositoriesService().addRemoteRepository( remoteRepository ); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexTest.java index 01b2cb6bf..213d19934 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexTest.java @@ -24,6 +24,7 @@ import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants; +import org.apache.archiva.redback.rest.services.BaseSetup; import org.apache.archiva.redback.rest.services.FakeCreateAdminService; import org.apache.archiva.rest.api.model.SearchRequest; import org.apache.archiva.rest.api.services.ManagedRepositoriesService; @@ -184,7 +185,7 @@ public class DownloadMergedIndexTest remoteRepository.setUrl( "http://localhost:" + port + "/repository/test-group" ); remoteRepository.setRemoteIndexUrl( "http://localhost:" + port + "/repository/test-group/.index" ); remoteRepository.setUserName( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME ); - remoteRepository.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD ); + remoteRepository.setPassword( BaseSetup.getAdminPwd() ); if ( getRemoteRepositoriesService().getRemoteRepository( remoteRepository.getId() ) != null ) {