diff options
author | Martin Stockhammer <martin.stockhammer@ars.de> | 2018-03-24 17:41:50 +0100 |
---|---|---|
committer | Martin Stockhammer <martin.stockhammer@ars.de> | 2018-03-24 17:44:13 +0100 |
commit | c544376afbec84689eae8ca5cc1a8f6a0ddb768d (patch) | |
tree | dfa67aabe758715dad9684e1909f6c6f649ee2b0 /archiva-modules/archiva-web/archiva-security/src | |
parent | e2eb9fe940feaa1606489c894182f2923bd54458 (diff) | |
download | archiva-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')
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 ) ); } |