diff options
author | Martin Stockhammer <martin_s@apache.org> | 2017-11-01 15:39:07 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2017-11-01 15:39:07 +0100 |
commit | d6120d6c22acd9996531716ae77806795277c9c7 (patch) | |
tree | 1a1e0fae2fa9478a6561ba31d48f9e02e1f57b91 /archiva-modules/archiva-web/archiva-security | |
parent | 32ff2ca265ac92be20f2941c7d4a291834e950f9 (diff) | |
download | archiva-d6120d6c22acd9996531716ae77806795277c9c7.tar.gz archiva-d6120d6c22acd9996531716ae77806795277c9c7.zip |
Adapting the web modules to the new repository api
Diffstat (limited to 'archiva-modules/archiva-web/archiva-security')
3 files changed, 9 insertions, 1 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 0d61740c3..25b0ed67d 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 @@ -32,6 +32,7 @@ import org.apache.archiva.redback.system.SecuritySystem; import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.UserManager; import org.apache.archiva.redback.users.UserManagerException; +import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.io.FileUtils; @@ -80,6 +81,9 @@ public abstract class AbstractSecurityTest private ArchivaConfiguration archivaConfiguration; @Inject + private RepositoryRegistry repositoryRegistry; + + @Inject protected UserRepositories userRepos; protected void setupRepository( String repoId ) @@ -94,6 +98,7 @@ public abstract class AbstractSecurityTest { archivaConfiguration.getConfiguration().addManagedRepository( repoConfig ); } + repositoryRegistry.reload(); // Add repo roles to security. userRepos.createMissingRepositoryRoles( repoId ); diff --git a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/mock/MockBeanServices.java b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/mock/MockBeanServices.java index d513a3539..9480019a0 100644 --- a/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/mock/MockBeanServices.java +++ b/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/mock/MockBeanServices.java @@ -156,7 +156,7 @@ public class MockBeanServices } @Override - public String getFilePath( String requestPath, ManagedRepository managedRepository ) + public String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository ) { return null; } diff --git a/archiva-modules/archiva-web/archiva-security/src/test/resources/spring-context.xml b/archiva-modules/archiva-web/archiva-security/src/test/resources/spring-context.xml index 696514868..fcc22aecc 100644 --- a/archiva-modules/archiva-web/archiva-security/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-security/src/test/resources/spring-context.xml @@ -27,6 +27,9 @@ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" default-lazy-init="true"> + <alias name="managedRepositoryContent#maven" alias="managedRepositoryContent#default" /> + <alias name="remoteRepositoryContent#maven" alias="remoteRepositoryContent#default" /> + <bean name="securitySystem#testable" class="org.apache.archiva.redback.system.DefaultSecuritySystem"> <property name="userManager" ref="userManager#memory"/> <property name="keyManager" ref="keyManager#memory"/> |