ArchivaConfiguration archivaConfiguration = applicationContext.getBean( ArchivaConfiguration.class );
archivaConfiguration.getConfiguration().setRepositoryScanning( new RepositoryScanningConfiguration() );
archivaConfiguration.save( configuration );
TestMetadataResolver metadataResolver = applicationContext.getBean( TestMetadataResolver.class );
ProjectVersionMetadata metadata = new ProjectVersionMetadata();
metadata.setId( TEST_VERSION );
metadataResolver.setProjectVersion( TEST_REPO_ID, TEST_GROUP_ID, TEST_ARTIFACT_ID, metadata );
RepositorySession repositorySession = mock( RepositorySession.class );
when( repositorySession.getResolver() ).thenReturn( metadataResolver );
TestRepositorySessionFactory repositorySessionFactory =
applicationContext.getBean( TestRepositorySessionFactory.class );