{
RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
//repositoriesService.scanRepositoryDirectoriesNow( SNAPSHOT_REPO_ID );
BrowseService browseService = getBrowseService( authorizationHeader, false );
List<Artifact> artifacts =
browseService.getArtifactDownloadInfos( "org.apache.archiva.redback.components", "spring-quartz",
"2.0-SNAPSHOT", SNAPSHOT_REPO_ID );
log.info( "artifacts: {}", artifacts );
Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 10 );
File artifactFile = new File( targetRepo,
"org/apache/archiva/redback/components/spring-quartz/2.0-SNAPSHOT/spring-quartz-2.0-20120618.214127-1.jar" );
File artifactFilemd5 = new File( targetRepo,
"org/apache/archiva/redback/components/spring-quartz/2.0-SNAPSHOT/spring-quartz-2.0-20120618.214127-1.jar.md5" );
File artifactFilepom = new File( targetRepo,
"org/apache/archiva/redback/components/spring-quartz/2.0-SNAPSHOT/spring-quartz-2.0-20120618.214127-1.pom" );
Assertions.assertThat( artifactFile ).exists();
Assertions.assertThat( artifactFilemd5 ).exists();
Assertions.assertThat( artifactFilepom ).exists();
// we delete only one snapshot
Artifact artifact =
new Artifact( "org.apache.archiva.redback.components", "spring-quartz", "2.0-20120618.214127-1" );
artifact.setPackaging( "jar" );
artifact.setRepositoryId( SNAPSHOT_REPO_ID );
artifact.setContext( SNAPSHOT_REPO_ID );
repositoriesService.deleteArtifact( artifact );
artifacts =
browseService.getArtifactDownloadInfos( "org.apache.archiva.redback.components", "spring-quartz",
"2.0-SNAPSHOT", SNAPSHOT_REPO_ID );
log.info( "artifacts: {}", artifacts );
Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 8 );