Annotation HandleException

  • All Implemented Interfaces:

    @ExtendWith(value = {HandleException.ExceptionHandler.class})@Target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.CLASS}) 
    public @interface HandleException
    
                        

    Аннотация, использующая перехватчик необработанных исключений.

    Если пойманы Error или TestAbortedException от методов класса Assert, они пробрасываются дальше. Остальные пойманные исключения (Exception) передаются в метод Assert.handleException.

    Может применяться к классу, от которого наследуются классы с автотестами, к классам с автотестами, к отдельным тестовым методам.

    Пример:

    @HandleException
    public class YourTests {
         @Test
         void test() {
             Logger.info(new ArrayList<String>().get(0));
         }
    }
    Since:

    2.1.5

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class HandleException.ExceptionHandler

      Перехватчик необработанных исключений

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class java.lang.Object

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

    • Method Detail