Class OutputGuardrailResultAssert

All Implemented Interfaces:
org.assertj.core.api.Assert<OutputGuardrailResultAssert,OutputGuardrailResult>, org.assertj.core.api.Descriptable<OutputGuardrailResultAssert>, org.assertj.core.api.ExtensionPoints<OutputGuardrailResultAssert,OutputGuardrailResult>

Custom assertions for OutputGuardrailResults

This follows the pattern described in https://assertj.github.io/doc/#assertj-core-custom-assertions-creation

  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new OutputGuardrailResultAssert for the provided OutputGuardrailResult.
    hasSingleFailureWithMessageAndReprompt(String expectedFailureMessage, String expectedReprompt)
    Asserts that the actual OutputGuardrailResult contains exactly one failure with the specified message and reprompt.

    Methods inherited from class org.assertj.core.api.AbstractObjectAssert

    as, as, doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison

    Methods inherited from class org.assertj.core.api.AbstractAssert

    actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, describedAs, describedAs
  • Method Details

    • assertThat

      public static OutputGuardrailResultAssert assertThat(OutputGuardrailResult actual)
      Creates a new OutputGuardrailResultAssert for the provided OutputGuardrailResult.
      Parameters:
      actual - the OutputGuardrailResult to be asserted
      Returns:
      an OutputGuardrailResultAssert instance for chaining further assertions
    • hasSingleFailureWithMessageAndReprompt

      public OutputGuardrailResultAssert hasSingleFailureWithMessageAndReprompt(String expectedFailureMessage, String expectedReprompt)
      Asserts that the actual OutputGuardrailResult contains exactly one failure with the specified message and reprompt. If the assertion fails, an error is thrown detailing the problem.
      Parameters:
      expectedFailureMessage - the expected message of the single failure
      expectedReprompt - the expected reprompt
      Returns:
      this assertion object for method chaining
      Throws:
      AssertionError - if the actual object is null, if there are no failures, if there is more than one failure, or if the single failure does not match the specified message