Class ChangeColumnAssert

All Implemented Interfaces:
org.assertj.core.api.Descriptable<ChangeColumnAssert>, AssertOnColumnClass<ChangeColumnAssert>, AssertOnColumnName<ChangeColumnAssert>, AssertOnColumnOfChangeEquality<ChangeColumnAssert>, AssertOnColumnType<ChangeColumnAssert>, AssertOnModifiedColumn<ChangeColumnAssert>, ColumnElement, Element, Navigation, Origin, OriginWithChanges<ChangesAssert,ChangeAssert>, OriginWithColumnsAndRowsFromChange<ChangesAssert,ChangeAssert,ChangeColumnAssert,ChangeRowAssert>, OriginWithValuesFromColumn<ChangesAssert,ChangeAssert,ChangeColumnAssert,ChangeRowAssert,ChangeColumnValueAssert>, ToChange<ChangeAssert>, ToChanges<ChangesAssert>, ToColumn<ChangeColumnAssert>, ToColumnFromChange<ChangeColumnAssert>, ToRowFromChange<ChangeRowAssert>, ToValueFromColumn<ChangeColumnValueAssert>

Assertion methods for a Column of a Change.
Author:
Régis Pouiller, Otoniel Isidoro
  • Field Details

    • columnName

      protected final String columnName
      The name of the column.
    • valueAtStartPoint

      protected final Value valueAtStartPoint
      The actual value at start point.
    • valueAtEndPoint

      protected final Value valueAtEndPoint
      The actual value at end point.
  • Constructor Details

    • ChangeColumnAssert

      public ChangeColumnAssert(ChangeAssert origin, String columnName, Value valueAtStartPoint, Value valueAtEndPoint)
      Constructor.
      Parameters:
      origin - The assertion of Origin.
      columnName - The column name.
      valueAtStartPoint - The value at start point.
      valueAtEndPoint - The value at end point.
  • Method Details

    • valueAtStartPoint

      public ChangeColumnValueAssert valueAtStartPoint()
      Returns assertion methods on the value at the start point.
      Specified by:
      valueAtStartPoint in interface ToValueFromColumn<ChangeColumnValueAssert>
      Returns:
      An object to make assertions on the next value.
      See Also:
    • valueAtEndPoint

      public ChangeColumnValueAssert valueAtEndPoint()
      Returns assertion methods on the value at the end point.
      Specified by:
      valueAtEndPoint in interface ToValueFromColumn<ChangeColumnValueAssert>
      Returns:
      An object to make assertions on the value.
      See Also:
    • isModified

      public ChangeColumnAssert isModified()
      Verifies that the column is modified between the start point and the end point.

      Example where the assertion verifies that :

       
       assertThat(changes).change(1).column().isModified();
       
       
      Specified by:
      isModified in interface AssertOnModifiedColumn<ChangeColumnAssert>
      Returns:
      this assertion object.
      See Also:
    • isNotModified

      public ChangeColumnAssert isNotModified()
      Verifies that the column is not modified between the start point and the end point.

      Example where the assertion verifies that :

       
       assertThat(changes).change(1).column().isNotModified();
       
       
      Specified by:
      isNotModified in interface AssertOnModifiedColumn<ChangeColumnAssert>
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Object expected)
      Verifies that the values at the start point and the end point are equal to a object.

      Example where the assertion verifies that the values of the first Column of the Table are equal to Locale.FRENCH :

      
       assertThat(changes).change(1).column().hasValues(Locale.FRENCH);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected object value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Object expectedAtStartPoint, Object expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a object for start point and another object for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to Locale.FRENCH at start point and Locale.ENGLISH at end point :

      
       assertThat(changes).change(1).column().hasValues(Locale.FRENCH, Locale.ENGLISH);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected object at start point.
      expectedAtEndPoint - The expected object at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Boolean expected)
      Verifies that the values at the start point and the end point are equal to a boolean.

      Example where the assertion verifies that the values of the first Column of the Table are equal to true :

      
       assertThat(changes).change(1).column().hasValues(true);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected boolean value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Boolean expectedAtStartPoint, Boolean expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a boolean for start point and another boolean for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to true at start point and false at end point :

      
       assertThat(changes).change(1).column().hasValues(true, false);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected boolean at start point.
      expectedAtEndPoint - The expected boolean at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Number expected)
      Verifies that the values at the start point and the end point are equal to a number.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 1 :

      
       assertThat(changes).change(1).column().hasValues(1);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected number value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Number expectedAtStartPoint, Number expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a number for start point and another number for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 1 at start point and 2 at end point :

      
       assertThat(changes).change(1).column().hasValues(1, 2);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected number at start point.
      expectedAtEndPoint - The expected number at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(byte[] expected)
      Verifies that the values at the start point and the end point are equal to bytes.

      Example where the assertion verifies that the values of the first Column of the Table are equal to a array of bytes loaded from a file in the classpath :

      
       byte[] bytes = bytesContentFromClassPathOf("file.png");
       assertThat(changes).change(1).column().hasValues(bytes);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected bytes value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(byte[] expectedAtStartPoint, byte[] expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to bytes for start point and other bytes for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to a array of bytes loaded from a file in the classpath at start point and another array at end point :

      
       byte[] bytes = bytesContentFromClassPathOf("file.png");
       byte[] bytes2 = bytesContentFromClassPathOf("file2.png");
       assertThat(changes).change(1).column().hasValues(bytes, bytes2);
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected bytes at start point.
      expectedAtEndPoint - The expected bytes at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(String expected)
      Verifies that the values at the start point and the end point are equal to a text.

      Example where the assertion verifies that the values of the first Column of the Table are equal to "Ellen Louise Ripley" :

      
       assertThat(changes).change(1).column().hasValues("Ellen Louise Ripley");
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected text value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(String expectedAtStartPoint, String expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a text for start point and another text for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to "Sigourney" at start point and "Susan Alexandra" at end point :

      
       assertThat(changes).change(1).column().hasValues("Sigourney", "Susan Alexandra");
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected text at start point.
      expectedAtEndPoint - The expected text at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Character expected)
      Verifies that the values at the start point and the end point are equal to a character.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 'c' :

      
       assertThat(changes).change(1).column().hasValues('c');
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected character value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(Character expectedAtStartPoint, Character expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a character for start point and another character for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 'c' at start point and 'S' at end point :

      
       assertThat(changes).change(1).column().hasValues('c', 'S');
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected character at start point.
      expectedAtEndPoint - The expected character at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(UUID expected)
      Verifies that the values at the start point and the end point are equal to an UUID.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 30B443AE-C0C9-4790-9BEC-CE1380808435 :

      
       assertThat(changes).change(1).column().hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected UUID value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(UUID expectedAtStartPoint, UUID expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to an UUID for start point and another UUID for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 30B443AE-C0C9-4790-9BEC-CE1380808435 at start point and 16319617-AE95-4087-9264-D3D21BF611B6 at end point :

      
       assertThat(changes).change(1).column().hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"), UUID.fromString("16319617-AE95-4087-9264-D3D21BF611B6"));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected UUID at start point.
      expectedAtEndPoint - The expected UUID at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(DateValue expected)
      Verifies that the values at the start point and the end point are equal to a date.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 12/23/2007 :

      
       assertThat(changes).change(1).column().hasValues(DateValue.of(2007, 12, 23));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected date value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(DateValue expectedAtStartPoint, DateValue expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a date for start point and another date for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 12/23/2007 at start point and 07/25/2002 at end point :

      
       assertThat(changes).change(1).column().hasValues(DateValue.of(2007, 12, 23), DateValue.of(2002, 7, 25));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected date at start point.
      expectedAtEndPoint - The expected date at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(TimeValue expected)
      Verifies that the values at the start point and the end point are equal to a time.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 09:01AM :

      
       assertThat(changes).change(1).column().hasValues(TimeValue.of(9, 1));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected time value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(TimeValue expectedAtStartPoint, TimeValue expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a time for start point and another time for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 09:01AM at start point and 03:30AM at end point :

      
       assertThat(changes).change(1).column().hasValues(TimeValue.of(9, 1), TimeValue.of(3, 30));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected time at start point.
      expectedAtEndPoint - The expected time at end point.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(DateTimeValue expected)
      Verifies that the values at the start point and the end point are equal to a date/time.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 12/23/2007 09:01AM :

      
       assertThat(changes).change(1).column().hasValues(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1)));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expected - The expected date/time value.
      Returns:
      this assertion object.
      See Also:
    • hasValues

      public ChangeColumnAssert hasValues(DateTimeValue expectedAtStartPoint, DateTimeValue expectedAtEndPoint)
      Verifies that the values at the start point and the end point are equal to a date/time for start point and another date/time for end point.

      Example where the assertion verifies that the values of the first Column of the Table are equal to 12/23/2007 09:01AM at start point and 07/25/2002 00:00AM at end point :

      
       assertThat(changes).change(1).column().hasValues(DateTimeValue.of(DateValue.of(2007, 12, 23), TimeValue.of(9, 1)), DateTimeValue.of(DateValue.of(2002, 7, 25)));
       
      Specified by:
      hasValues in interface AssertOnColumnOfChangeEquality<ChangeColumnAssert>
      Parameters:
      expectedAtStartPoint - The expected date/time at start point.
      expectedAtEndPoint - The expected date/time at end point.
      Returns:
      this assertion object.
      See Also:
    • hasColumnName

      public ChangeColumnAssert hasColumnName(String columnName)
      Verifies that the name of a column is equal to the parameter.

      Example where the assertion verifies that the column name of the first Column of the Table is equal to "title" :

      
       assertThat(table).column().hasColumnName("title");
       

      Example where the assertion verifies that the first value of the first Row of the Table is equal to "title" :

      
       assertThat(table).row().value().hasColumnName("title");
       

      Example where the assertion verifies that the column name of the first Column of the Table is equal to "title" :

      
       assertThat(changes).change(1).column().hasColumnName("title");
       

      Example where the assertion verifies that the first value of the first Row of the Table is equal to "title" :

      
       assertThat(changes).change(1).row().value().hasColumnName("title");
       
      Specified by:
      hasColumnName in interface AssertOnColumnName<ChangeColumnAssert>
      Parameters:
      columnName - The expected column name.
      Returns:
      this assertion object.
      See Also:
    • isOfClass

      public ChangeColumnAssert 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);
       
      Specified by:
      isOfClass in interface AssertOnColumnClass<ChangeColumnAssert>
      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.
      See Also:
    • isOfType

      public ChangeColumnAssert isOfType(ValueType expected, boolean lenient)
      Verifies that the type of the values of the column is equal to the type in parameter.

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

      
       assertThat(table).column("title").isOfType(ValueType.TEXT, false);
       

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

      
       assertThat(table).column("title").isOfType(ValueType.TEXT, true);
       
      Specified by:
      isOfType in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      expected - The expected type to compare to.
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isOfAnyTypeIn

      public ChangeColumnAssert isOfAnyTypeIn(ValueType... expected)
      Verifies that the type of the column is equal to one of the types in parameters.

      Example where the assertion verifies that the values in the Column called "title" of the Table is of type TEXT or of type NUMBER :

      
       assertThat(table).column("title").isOfAnyTypeIn(ValueType.TEXT, ValueType.NUMBER);
       
      Specified by:
      isOfAnyTypeIn in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      expected - The expected types to compare to.
      Returns:
      this assertion object.
      See Also:
    • isNumber

      public ChangeColumnAssert isNumber(boolean lenient)
      Verifies that the type of the values of the column is number.

      Example where the assertion verifies that all the values in the Column called "year" of the Table is a number :

      
       assertThat(table).column("year").isNumber(true);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.NUMBER, lenient);
       
       
      Specified by:
      isNumber in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isBoolean

      public ChangeColumnAssert isBoolean(boolean lenient)
      Verifies that the type of the values of the column is boolean.

      Example where the assertion verifies that all the values in the first Column of the Table is a boolean :

      
       assertThat(table).column().isBoolean(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BOOLEAN, lenient);
       
       
      Specified by:
      isBoolean in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isDate

      public ChangeColumnAssert isDate(boolean lenient)
      Verifies that the type of the values of the column is date.

      Example where the assertion verifies that all the values in the Column called "birth" of the Table is a date :

      
       assertThat(table).column("birth").isDate(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE, lenient);
       
       
      Specified by:
      isDate in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isTime

      public ChangeColumnAssert isTime(boolean lenient)
      Verifies that the type of the values of the column is time.

      Example where the assertion verifies that all the values in the first Column of the Table is a time :

      
       assertThat(table).column().isTime(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TIME, lenient);
       
       
      Specified by:
      isTime in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isDateTime

      public ChangeColumnAssert isDateTime(boolean lenient)
      Verifies that the type of the values of the column is date/time.

      Example where the assertion verifies that all the values in the first Column of the Table is a date/time :

      
       assertThat(table).column().isDateTime(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE_TIME, lenient);
       
       
      Specified by:
      isDateTime in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isBytes

      public ChangeColumnAssert isBytes(boolean lenient)
      Verifies that the type of the values of the column is array of bytes.

      Example where the assertion verifies that all the values in the first Column of the Table is a array of bytes :

      
       assertThat(table).column().isBytes(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BYTES, lenient);
       
       
      Specified by:
      isBytes in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isText

      public ChangeColumnAssert isText(boolean lenient)
      Verifies that the type of the values of the column is text.

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

      
       assertThat(table).column("title").isText(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TEXT, lenient);
       
       
      Specified by:
      isText in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • isUUID

      public ChangeColumnAssert isUUID(boolean lenient)
      Verifies that the type of the values of the column is UUID.

      Example where the assertion verifies that all the values in the Column called "id" of the Table is UUID :

      
       assertThat(table).column("id").isUUID(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.UUID, lenient);
       
       
      Specified by:
      isUUID in interface AssertOnColumnType<ChangeColumnAssert>
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      See Also:
    • returnToChange

      public ChangeAssert returnToChange()
      Returns to level of assertion methods on a Change.
      Returns:
      a object of assertion methods on a Change.