Switching to new API

This commit is contained in:
Martin Stockhammer 2020-06-07 19:09:02 +02:00
parent 91900a6376
commit aa8de8c74b
3 changed files with 10 additions and 9 deletions

View File

@ -47,7 +47,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase1Test
taskExecutor.executeTask( repoTask );
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
Collection<String> unprocessedResultList = testConsumer.getConsumed();
assertNotNull( unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );

View File

@ -58,7 +58,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
taskExecutor.executeTask( repoTask );
// check no artifacts processed
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
Collection<String> unprocessedResultList = testConsumer.getConsumed();
assertNotNull( unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected. No new artifacts should have been found.", 0,
@ -139,7 +139,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
taskExecutor.executeTask( repoTask );
// check no artifacts processed
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
Collection<String> unprocessedResultList = testConsumer.getConsumed();
assertNotNull( unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
unprocessedResultList.size() );
@ -186,7 +186,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
taskExecutor.executeTask( repoTask );
// check no artifacts processed
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
Collection<String> unprocessedResultList = testConsumer.getConsumed();
assertNotNull( unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
unprocessedResultList.size() );
@ -219,7 +219,7 @@ public class ArchivaRepositoryScanningTaskExecutorPhase2Test
taskExecutor.executeTask( repoTask );
Collection<ArtifactReference> unprocessedResultList = testConsumer.getConsumed();
Collection<String> unprocessedResultList = testConsumer.getConsumed();
assertNotNull( unprocessedResultList );
assertEquals( "Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );

View File

@ -43,7 +43,7 @@ public class TestConsumer
extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer
{
private Set<ArtifactReference> consumed = new HashSet<ArtifactReference>();
private Set<String> consumed = new HashSet<>();
@Inject
private RepositoryContentFactory factory;
@ -98,11 +98,12 @@ public class TestConsumer
{
try
{
consumed.add( repository.toArtifactReference( path ) );
repository.toItemSelector( path );
consumed.add( path );
}
catch ( LayoutException e )
{
throw new ConsumerException( e.getMessage(), e );
// Layout exception for specific paths
}
}
}
@ -125,7 +126,7 @@ public class TestConsumer
completeScan();
}
public Collection<ArtifactReference> getConsumed()
public Collection<String> getConsumed()
{
return consumed;
}