Class ThrowableSubject

    • Field Detail

      • actual

        private final java.lang.Throwable actual
    • Constructor Detail

      • ThrowableSubject

        protected ThrowableSubject​(FailureMetadata metadata,
                                   java.lang.Throwable throwable)
        Constructor for use by subclasses. If you want to create an instance of this class itself, call check(...).that(actual).
      • ThrowableSubject

        ThrowableSubject​(FailureMetadata metadata,
                         java.lang.Throwable throwable,
                         java.lang.String typeDescription)
    • Method Detail

      • hasMessageThat

        public final StringSubject hasMessageThat()
        Returns a StringSubject to make assertions about the throwable's message.
      • hasCauseThat

        public final ThrowableSubject hasCauseThat()
        Returns a new ThrowableSubject that supports assertions on this throwable's direct cause. This method can be invoked repeatedly (e.g. assertThat(e).hasCauseThat().hasCauseThat().... to assert on a particular indirect cause.