Search in sources :

Example 1 with DatabasePanicEventGenerator

use of org.neo4j.kernel.monitoring.DatabasePanicEventGenerator in project neo4j by neo4j.

the class DatabaseHealthTest method shouldGenerateDatabasePanicEvents.

@Test
void shouldGenerateDatabasePanicEvents() {
    // GIVEN
    DatabasePanicEventGenerator generator = mock(DatabasePanicEventGenerator.class);
    Health databaseHealth = new DatabaseHealth(generator, NullLogProvider.getInstance().getLog(DatabaseHealth.class));
    databaseHealth.healed();
    // WHEN
    Exception cause = new Exception("My own fault");
    databaseHealth.panic(cause);
    databaseHealth.panic(cause);
    // THEN
    verify(generator).panic(cause);
}
Also used : DatabaseHealth(org.neo4j.monitoring.DatabaseHealth) Health(org.neo4j.monitoring.Health) DatabaseHealth(org.neo4j.monitoring.DatabaseHealth) DatabasePanicEventGenerator(org.neo4j.kernel.monitoring.DatabasePanicEventGenerator) IOException(java.io.IOException) Test(org.junit.jupiter.api.Test)

Aggregations

IOException (java.io.IOException)1 Test (org.junit.jupiter.api.Test)1 DatabasePanicEventGenerator (org.neo4j.kernel.monitoring.DatabasePanicEventGenerator)1 DatabaseHealth (org.neo4j.monitoring.DatabaseHealth)1 Health (org.neo4j.monitoring.Health)1