mirror of https://github.com/apache/archiva.git
Fixing test case NPE wrt repo.location.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@583652 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9aa41ce31b
commit
46c2f650b3
|
@ -111,7 +111,7 @@ public class RepositoryServlet
|
||||||
{
|
{
|
||||||
if ( repositoryMap.isEmpty() )
|
if ( repositoryMap.isEmpty() )
|
||||||
{
|
{
|
||||||
repositoryMap = configuration.getConfiguration().getManagedRepositoriesAsMap();
|
repositoryMap.putAll( configuration.getConfiguration().getManagedRepositoriesAsMap() );
|
||||||
}
|
}
|
||||||
return repositoryMap.get( prefix );
|
return repositoryMap.get( prefix );
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,12 @@ public class RepositoryServletTest
|
||||||
ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
|
ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
|
||||||
repo.setId( NEW_REPOSITORY_ID );
|
repo.setId( NEW_REPOSITORY_ID );
|
||||||
repo.setName( NEW_REPOSITORY_NAME );
|
repo.setName( NEW_REPOSITORY_NAME );
|
||||||
|
File repoRoot = new File( getBasedir(), "target/test-repository-root" );
|
||||||
|
if ( !repoRoot.exists() )
|
||||||
|
{
|
||||||
|
repoRoot.mkdirs();
|
||||||
|
}
|
||||||
|
repo.setLocation( repoRoot.getAbsolutePath() );
|
||||||
c.addManagedRepository( repo );
|
c.addManagedRepository( repo );
|
||||||
// TODO it would be better to use a mock configuration and "save" to more accurately reflect the calls made
|
// TODO it would be better to use a mock configuration and "save" to more accurately reflect the calls made
|
||||||
servlet.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED) );
|
servlet.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED) );
|
||||||
|
|
Loading…
Reference in New Issue