Package org.qaddict

Class Assert

java.lang.Object
org.qaddict.Assert

public class Assert extends Object
Assertion entry point
  • Constructor Details

    • Assert

      public Assert()
  • Method Details

    • that

      public static <D> D that(D data, Expectation<? super D> expectation)
      Assert, that provided data satisfies the expectation. In case, that it satisfies the expectation, then the method returns the data itself. If not, then AssertionError is thrown with description, which extracts the mismatched details.
      Type Parameters:
      D - Type of the validated data.
      Parameters:
      data - Data to be exercised by the expectation.
      expectation - Expectation to apply on the data.
      Returns:
      Tha data, if it meets the expectation.
    • describe

      public static String describe(ActualValueNode node)
      Describe the mismatched parts from the evaluation details.
      Parameters:
      node - Node representing the full detail of information about the expectation evaluation.
      Returns:
      String with listed mismatches causing the validation failure.