when( session.getRepository() ).thenReturn( metadataRepository );
TestRepositorySessionFactory factory =
applicationContext.getBean( "repositorySessionFactory#test", TestRepositorySessionFactory.class );
factory.setRepositorySession( session );
ServletRunner sr = new ServletRunner();
ServletUnitClient sc = sr.newClient();
action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositories.action" ).getRequest() );
action.prepare();
String result = action.execute();