Class ExpectedExceptionExtension

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

    public class ExpectedExceptionExtension
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleTestExecutionException​(org.junit.jupiter.api.extension.ExtensionContext context, java.lang.Throwable throwable)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExpectedExceptionExtension

        public ExpectedExceptionExtension()
    • Method Detail

      • handleTestExecutionException

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