use of org.neo4j.dbms.database.StandaloneDatabaseContext in project neo4j by neo4j.
the class DbmsDiagnosticsManagerTest method dumpDiagnosticsInConciseForm.
@Test
void dumpDiagnosticsInConciseForm() {
Map<NamedDatabaseId, StandaloneDatabaseContext> databaseMap = new HashMap<>();
int numberOfDatabases = 1000;
for (int i = 0; i < numberOfDatabases; i++) {
Database database = mock(Database.class);
NamedDatabaseId namedDatabaseId = TestDatabaseIdRepository.randomNamedDatabaseId();
when(database.getNamedDatabaseId()).thenReturn(namedDatabaseId);
databaseMap.put(namedDatabaseId, new StandaloneDatabaseContext(database));
}
when(databaseManager.registeredDatabases()).thenReturn(new TreeMap<>(databaseMap));
diagnosticsManager.dumpAll();
var logAssertions = assertThat(logProvider);
var databaseNames = databaseMap.keySet().stream().map(NamedDatabaseId::name).toArray(String[]::new);
logAssertions.containsMessagesOnce(databaseNames);
}
Aggregations