use of org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor.ENGINE_ID in project neo4j by neo4j.
the class LifeExtensionTest method incorrectLifeSupportExtensionUsageTest.
@Test
void incorrectLifeSupportExtensionUsageTest() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(LifeExtensionIncorrectUsage.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(ExtensionConfigurationException.class), message(message -> message.contains("Field lifeSupport that is marked for injection")))));
}
use of org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor.ENGINE_ID in project neo4j by neo4j.
the class SuppressOutputExtensionTest method shouldThrowExceptionOnMissingResourceLock.
@Test
void shouldThrowExceptionOnMissingResourceLock() {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(SuppressOutputExtensionIncorrectUsage.class)).execute().testEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(IllegalStateException.class), message(message -> message.contains("SuppressOutputExtension requires `@ResourceLock( Resources.SYSTEM_OUT )` annotation.")))));
}
use of org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor.ENGINE_ID in project neo4j by neo4j.
the class ThreadLeakageGuardExtensionTest method threadLeakageTest.
@Test
void threadLeakageTest() throws InterruptedException {
Events testEvents = EngineTestKit.engine(ENGINE_ID).selectors(selectClass(IncorrectThreadLeakage.class)).execute().allEvents();
testEvents.assertThatEvents().haveExactly(1, event(finishedWithFailure(instanceOf(ExtensionContextException.class), message(message -> message.contains("1 leaked thread(s) detected")))));
IncorrectThreadLeakage.cleanUp();
}
Aggregations