Class OutputGuardrailResultAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<OutputGuardrailResultAssert, OutputGuardrailResult>
org.assertj.core.api.AbstractObjectAssert<OutputGuardrailResultAssert, OutputGuardrailResult>
dev.langchain4j.test.guardrail.GuardrailResultAssert<OutputGuardrailResultAssert, OutputGuardrailResult, OutputGuardrailResult.Failure>
dev.langchain4j.test.guardrail.OutputGuardrailResultAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<OutputGuardrailResultAssert, OutputGuardrailResult>, org.assertj.core.api.Descriptable<OutputGuardrailResultAssert>, org.assertj.core.api.ExtensionPoints<OutputGuardrailResultAssert, OutputGuardrailResult>
public final class OutputGuardrailResultAssert
extends GuardrailResultAssert<OutputGuardrailResultAssert, OutputGuardrailResult, OutputGuardrailResult.Failure>
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 TypeMethodDescriptionstatic OutputGuardrailResultAssertassertThat(OutputGuardrailResult actual) Creates a newOutputGuardrailResultAssertfor the providedOutputGuardrailResult.hasSingleFailureWithMessageAndReprompt(String expectedFailureMessage, String expectedReprompt) Asserts that the actualOutputGuardrailResultcontains exactly one failure with the specified message and reprompt.Methods inherited from class GuardrailResultAssert
assertSingleFailureSatisfies, hasFailures, hasResult, hasSingleFailureWithMessage, hasSuccessfulText, isSuccessful, withFailuresMethods 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, usingRecursiveComparisonMethods 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, withThreadDumpOnErrorMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, describedAs, describedAs
-
Method Details
-
assertThat
Creates a newOutputGuardrailResultAssertfor the providedOutputGuardrailResult.- Parameters:
actual- theOutputGuardrailResultto be asserted- Returns:
- an
OutputGuardrailResultAssertinstance for chaining further assertions
-
hasSingleFailureWithMessageAndReprompt
public OutputGuardrailResultAssert hasSingleFailureWithMessageAndReprompt(String expectedFailureMessage, String expectedReprompt) Asserts that the actualOutputGuardrailResultcontains 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 failureexpectedReprompt- 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
-