Search in sources :

Example 1 with ExtensionConfigurationException

use of org.junit.jupiter.api.extension.ExtensionConfigurationException in project junit5 by junit-team.

the class ScriptExecutionConditionTests method throwingEvaluatorExceptionMessage.

@Test
void throwingEvaluatorExceptionMessage() {
    String message = "Mock for message";
    ReflectiveOperationException cause = new ReflectiveOperationException("Mock for ReflectiveOperationException");
    ScriptExecutionCondition.Evaluator evaluator = new ScriptExecutionCondition.ThrowingEvaluator(message, cause);
    Exception e = assertThrows(Exception.class, () -> evaluator.evaluate(null, null));
    assertTrue(e instanceof ExtensionConfigurationException);
    assertEquals(message, e.getMessage());
}
Also used : ExtensionConfigurationException(org.junit.jupiter.api.extension.ExtensionConfigurationException) JUnitException(org.junit.platform.commons.JUnitException) ExtensionConfigurationException(org.junit.jupiter.api.extension.ExtensionConfigurationException) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ExtensionConfigurationException (org.junit.jupiter.api.extension.ExtensionConfigurationException)1 JUnitException (org.junit.platform.commons.JUnitException)1