assertAll

assertAll is very similar to assert except is performs validation on a collection of objects.

  • This is useful to validate on a collection of objects of the outer type.
// Outer type definition
...
   assertAll <Unique assertion identifier> ( objs )  {
       < Expressions >
   }
...

The objs variable will be of the type of a list of the outer user-defined type.

Everything that applies to assert applies to assertAll. Having a collection allows certain operations to be performed more efficiently, for example extract the unique set of values for a field, and check if it exists using a lookup.

For example datasets like CSV, JSON lines, Avro can be validated as an assertAll if the entire batch should be considered for some validations.