diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java index c1144c2a9..6bc27bd8f 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/reports/GenerateReportActionTest.java @@ -93,9 +93,8 @@ public class GenerateReportActionTest RepositorySession repositorySession = mock( RepositorySession.class ); when( repositorySession.getRepository() ).thenReturn( metadataRepository ); - //TestRepositorySessionFactory factory = (TestRepositorySessionFactory) lookup( RepositorySessionFactory.class ); - - TestRepositorySessionFactory factory = new TestRepositorySessionFactory(); + TestRepositorySessionFactory factory = + applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class ); factory.setRepositorySession( repositorySession ); }