use of org.apache.archiva.metadata.repository.RepositorySessionFactory in project archiva by apache.
the class DuplicateArtifactsConsumerTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
assertNotNull(consumer);
config = new BasicManagedRepository(TEST_REPO, TEST_REPO, Paths.get("target"));
config.setLocation(Paths.get("target/test-repository").toAbsolutePath().toUri());
metadataRepository = mock(MetadataRepository.class);
RepositorySession session = mock(RepositorySession.class);
when(session.getRepository()).thenReturn(metadataRepository);
RepositorySessionFactory factory = applicationContext.getBean(RepositorySessionFactory.class);
// (RepositorySessionFactory) lookup( RepositorySessionFactory.class );
when(factory.createSession()).thenReturn(session);
when(pathTranslator.getArtifactForPath(TEST_REPO, TEST_FILE)).thenReturn(TEST_METADATA);
}
use of org.apache.archiva.metadata.repository.RepositorySessionFactory in project archiva by apache.
the class TestRepositorySessionFactoryBean method createInstance.
@Override
protected RepositorySessionFactory createInstance() throws Exception {
RepositorySessionFactory repositorySessionFactory = getBeanFactory().getBean("repositorySessionFactory#" + this.beanId, RepositorySessionFactory.class);
logger.info("create RepositorySessionFactory instance of {}", repositorySessionFactory.getClass().getName());
if (!repositorySessionFactory.isOpen()) {
repositorySessionFactory.open();
}
return repositorySessionFactory;
}
Aggregations