static DatabaseInfo databaseInfo;
@Test
public void testGetDatabaseFactory() throws Exception {
final FilterConfig config = mock(FilterConfig.class);
final ServletContext context = mock(ServletContext.class);
final GraphDatabaseService database = mock(GraphDatabaseService.class);
when(context.getAttribute(argThat(is(ConsoleFilter.DATABASE_ATTRIBUTE)))).thenReturn(DatabaseInfo.sandbox(database));
when(config.getServletContext()).thenReturn(context);
when(config.getInitParameter(argThat(is("applicationClass")))).thenReturn(TestApplication.class.getName());
new ConsoleFilter().init(config);
assertThat(databaseInfo.getDatabase(),is(database));
assertThat(databaseInfo.isSandbox(),is(true));
}