Class ExpectedExceptionExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestExecutionExceptionHandler

    public class ExpectedExceptionExtension
    extends Object
    implements org.junit.jupiter.api.extension.TestExecutionExceptionHandler
    TestExecutionExceptionHandler used in conjunction with ExpectedException to support annotating tests with a specific exception that indicates a success (we are expecting that exception in that tested condition).
    See Also:
    ExpectedException
    • Constructor Detail

      • ExpectedExceptionExtension

        public ExpectedExceptionExtension()
    • Method Detail

      • handleTestExecutionException

        public void handleTestExecutionException​(org.junit.jupiter.api.extension.ExtensionContext context,
                                                 Throwable throwable)
                                          throws Throwable
        Specified by:
        handleTestExecutionException in interface org.junit.jupiter.api.extension.TestExecutionExceptionHandler
        Throws:
        Throwable