aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-security/src
diff options
context:
space:
mode:
authorMartin Stockhammer <martin.stockhammer@ars.de>2018-03-24 17:41:50 +0100
committerMartin Stockhammer <martin.stockhammer@ars.de>2018-03-24 17:44:13 +0100
commitc544376afbec84689eae8ca5cc1a8f6a0ddb768d (patch)
treedfa67aabe758715dad9684e1909f6c6f649ee2b0 /archiva-modules/archiva-web/archiva-security/src
parente2eb9fe940feaa1606489c894182f2923bd54458 (diff)
downloadarchiva-c544376afbec84689eae8ca5cc1a8f6a0ddb768d.tar.gz
archiva-c544376afbec84689eae8ca5cc1a8f6a0ddb768d.zip
Switching repository admin and dependent classes to RepositoryRegistry
RepositoryRegistry is used for indexing context now. There is still more work to do to move the maven dependent parts into its own projects and update the dependencies.
Diffstat (limited to 'archiva-modules/archiva-web/archiva-security/src')
-rw-r--r--archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java6
-rw-r--r--archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/DefaultUserRepositoriesTest.java2
2 files changed, 5 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java
index 25b0ed67d..b58aae891 100644
--- a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java
+++ b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java
@@ -96,9 +96,8 @@ public abstract class AbstractSecurityTest
repoConfig.setLocation( Paths.get( "target/test-repo/" + repoId ).toString() );
if ( !archivaConfiguration.getConfiguration().getManagedRepositoriesAsMap().containsKey( repoId ) )
{
- archivaConfiguration.getConfiguration().addManagedRepository( repoConfig );
+ repositoryRegistry.putRepository( repoConfig );
}
- repositoryRegistry.reload();
// Add repo roles to security.
userRepos.createMissingRepositoryRoles( repoId );
@@ -152,6 +151,9 @@ public abstract class AbstractSecurityTest
// Setup Guest User.
User guestUser = createUser( USER_GUEST, "Guest User" );
roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, guestUser.getUsername() );
+
+ repositoryRegistry.setArchivaConfiguration(archivaConfiguration);
+ repositoryRegistry.reload();
}
protected void restoreGuestInitialValues( String userId )
diff --git a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/DefaultUserRepositoriesTest.java b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/DefaultUserRepositoriesTest.java
index cef688739..c92dc43ac 100644
--- a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/DefaultUserRepositoriesTest.java
+++ b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/DefaultUserRepositoriesTest.java
@@ -73,7 +73,7 @@ public class DefaultUserRepositoriesTest
assertRepoIds( new String[]{ "central", "corporate" }, userRepos.getObservableRepositoryIds( USER_ALPACA ) );
assertRepoIds( new String[]{ "coporate" }, userRepos.getObservableRepositoryIds( USER_GUEST ) );
- assertRepoIds( new String[]{ "central", "internal", "corporate", "snapshots", "secret" },
+ assertRepoIds( new String[]{ "central", "internal","corporate", "snapshots", "secret" },
userRepos.getObservableRepositoryIds( USER_ADMIN ) );
}