Class ThrowableIsCausedByMatcher

    • Method Detail

      • hasRootCause

        @SafeVarargs
        public static ThrowableIsCausedByMatcher hasRootCause​(org.hamcrest.Matcher<? super Throwable>... matchers)
        Defines criteria to find any suitable throwable-cause of the verified throwable
        Parameters:
        matchers - criteria to check throwable
        Returns:
        an instance of ThrowableIsCausedByMatcher that checks all throwable-causes of the verified throwable until it finds ane that matches all defined criteria
      • hasRootCause

        public static <T extends ThrowableThrowableIsCausedByMatcher hasRootCause​(Class<T> expectedClass)
        Defines expected class to find any suitable throwable-cause of the verified throwable
        Type Parameters:
        T - is a type of throwable-cause
        Parameters:
        expectedClass - is expected class of throwable-cause
        Returns:
        an instance of ThrowableIsCausedByMatcher that checks all throwable-causes of the verified throwable until it finds ane that matches all defined criteria
      • hasRootCause

        public static <T extends ThrowableThrowableIsCausedByMatcher hasRootCause​(Class<T> expectedClass,
                                                                                    String message)
        Defines expected class and message to find any suitable throwable-cause of the verified throwable
        Type Parameters:
        T - is a type of throwable-cause
        Parameters:
        expectedClass - is expected class of throwable-cause
        message - is expected message of throwable-cause
        Returns:
        an instance of ThrowableIsCausedByMatcher that checks all throwable-causes of the verified throwable until it finds ane that matches all defined criteria
      • hasRootCause

        @SafeVarargs
        public static <T extends ThrowableThrowableIsCausedByMatcher hasRootCause​(Class<T> expectedClass,
                                                                                    org.hamcrest.Matcher<? super String>... messageMatchers)
        Defines expected class and message criteria to find any suitable throwable-cause of the verified throwable
        Type Parameters:
        T - is a type of throwable-cause
        Parameters:
        expectedClass - is expected class of throwable-cause
        messageMatchers - criteria to check message of a throwable
        Returns:
        an instance of ThrowableIsCausedByMatcher that checks all throwable-causes of the verified throwable until it finds ane that matches all defined criteria