stageRepoConfiguration.addManagedRepository( createStagingRepository() );
archivaConfigurationControl.setReturnValue( stageRepoConfiguration );
+
+ archivaConfiguration.getConfiguration();
+ archivaConfigurationControl.setReturnValue( configuration );
+
+
archivaConfigurationControl.replay();
action.setRepoid( REPO_ID );
repository = action.getRepository();
assertRepositoryEquals( repository, createRepository() );
- assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() );
+ assertEquals( Collections.singletonList( originalRepository ),
+ action.getManagedRepositoryAdmin().getManagedRepositories() );
}
public void testDeleteRepositoryKeepContent()
ManagedRepository repository = action.getRepository();
assertRepositoryEquals( repository, createRepository() );
- assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() );
+ assertEquals( Collections.singletonList( originalRepository ),
+ action.getManagedRepositoryAdmin().getManagedRepositories() );
assertTrue( location.exists() );
private Configuration prepDeletionTest( ManagedRepository originalRepository, int expectCountGetConfig )
throws RegistryException, IndeterminateConfigurationException, RepositoryAdminException
{
+
+ //Configuration originalConfiguration =
+ // ( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).getArchivaConfiguration().getConfiguration();
+
location.mkdirs();
Configuration configuration = createConfigurationForEditing( originalRepository );
private Configuration createConfigurationForEditing( ManagedRepository repositoryConfiguration )
{
Configuration configuration = new Configuration();
- configuration.addManagedRepository(
- new BeanReplicator().replicateBean( repositoryConfiguration, ManagedRepositoryConfiguration.class ) );
+ ManagedRepositoryConfiguration managedRepositoryConfiguration =
+ new BeanReplicator().replicateBean( repositoryConfiguration, ManagedRepositoryConfiguration.class );
+ managedRepositoryConfiguration.setRefreshCronExpression( repositoryConfiguration.getCronExpression() );
+ configuration.addManagedRepository( managedRepositoryConfiguration );
return configuration;
}