Interface AssertOnColumnClass<T extends AssertOnColumnClass<T>>

Type Parameters:
T - The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
All Known Implementing Classes:
AbstractColumnAssert, ChangeColumnAssert, RequestColumnAssert, TableColumnAssert

public interface AssertOnColumnClass<T extends AssertOnColumnClass<T>>
Defines the assertion method on the class of a column.
Since:
1.1.0
Author:
Régis Pouiller
  • Method Summary

    Modifier and Type
    Method
    Description
    isOfClass(Class<?> expected, boolean lenient)
    Verifies that the class of the values of the column is equal to the class in parameter.
  • Method Details

    • isOfClass

      T isOfClass(Class<?> expected, boolean lenient)
      Verifies that the class of the values of the column is equal to the class in parameter.

      Example where the assertion verifies that all the values in the Column called "title" of the Table is of class String :

      
       assertThat(table).column("title").isOfClass(String.class, false);
       

      Example where the assertion verifies that all the values in the Column called "title" of the Table is of class String or not identified (for example null) :

      
       assertThat(table).column("title").isOfClass(String.class, true);
       
      Parameters:
      expected - The expected class to compare to.
      lenient - true if the test is lenient : if the class of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the class of the column is different to the class in parameter.
      Since:
      1.1.0
      See Also: