Interface AssertOnValueType<T extends AssertOnValueType<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:
AbstractAssertWithValues,AbstractColumnValueAssert,AbstractRowValueAssert,AbstractValueAssert,ChangeColumnValueAssert,ChangeRowValueAssert,RequestColumnValueAssert,RequestRowValueAssert,TableColumnValueAssert,TableRowValueAssert
The different type of values are enumerated in ValueType.
- Author:
- Régis Pouiller, Otoniel Isidoro
-
Method Summary
Modifier and TypeMethodDescriptionVerifies that the value is a boolean.isBytes()Verifies that the value is a array of bytes.isDate()Verifies that the value is a date.Verifies that the value is a date/time.isNumber()Verifies that the value is a number.isOfAnyTypeIn(ValueType... expected) Verifies that the type of the value is equal to one of the types in parameters.Verifies that the type of the value is equal to the type in parameter.isText()Verifies that the value is a text.isTime()Verifies that the value is a time.isUUID()Verifies that the value is an UUID.
-
Method Details
-
isOfType
Verifies that the type of the value is equal to the type in parameter.Example where the assertion verifies that the value in the
Columncalled "title" of the secondRowof theTableis of typeTEXT:assertThat(table).row(1).value("title").isOfType(ValueType.TEXT);Example where the assertion verifies that the value in the
Columncalled "title" of theRowat end point of the firstChangeis of typeTEXT:assertThat(changes).change().rowAtEndPoint().value("title").isOfType(ValueType.TEXT);- Parameters:
expected- The expected type to compare to.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is different to the type in parameter.- See Also:
-
isOfAnyTypeIn
Verifies that the type of the value is equal to one of the types in parameters.Example where the assertion verifies that the value in the
Columncalled "title" of the secondRowof theTableis of typeTEXTor of typeNUMBER:assertThat(table).row(1).value("title").isOfType(ValueType.TEXT, ValueType.NUMBER);Example where the assertion verifies that the value in the
Columncalled "title" of theRowat end point of the firstChangeis of typeTEXTor of typeNUMBER:assertThat(changes).change().rowAtEndPoint().value("title").isOfType(ValueType.TEXT, ValueType.NUMBER);- Parameters:
expected- The expected types to compare to.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is different to all the types in parameters.- See Also:
-
isNumber
T isNumber()Verifies that the value is a number.Example where the assertion verifies that the value in the
Columncalled "year" of the firstRowof theTableis a number :assertThat(table).row().value("year").isNumber();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a number :assertThat(changes).change().rowAtEndPoint().value().isNumber();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.NUMBER);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not number.- See Also:
-
isBoolean
T isBoolean()Verifies that the value is a boolean.Example where the assertion verifies that the value in the first
Columnof the firstRowof theTableis a boolean :assertThat(table).row().value().isBoolean();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a boolean :assertThat(changes).change().rowAtEndPoint().value().isBoolean();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.BOOLEAN);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not boolean.- See Also:
-
isDate
T isDate()Verifies that the value is a date.Example where the assertion verifies that the value in the
Columncalled "birth" of the firstRowof theTableis a date :assertThat(table).row().value("birth").isDate();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a date :assertThat(changes).change().rowAtEndPoint().value().isDate();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.DATE);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not date.- See Also:
-
isTime
T isTime()Verifies that the value is a time.Example where the assertion verifies that the value in the first
Columnof the firstRowof theTableis a time :assertThat(table).row().value().isTime();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a time :assertThat(changes).change().rowAtEndPoint().value().isTime();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.TIME);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not time.- See Also:
-
isDateTime
T isDateTime()Verifies that the value is a date/time.Example where the assertion verifies that the value in the first
Columnof the firstRowof theTableis a date/time :assertThat(table).row().value().isDateTime();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a date/time :assertThat(changes).change().rowAtEndPoint().value().isDateTime();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.DATE_TIME);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not date/time.- See Also:
-
isBytes
T isBytes()Verifies that the value is a array of bytes.Example where the assertion verifies that the value in the first
Columnof the firstRowof theTableis a array of bytes :assertThat(table).row().value().isBytes();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a array of bytes :assertThat(changes).change().rowAtEndPoint().value().isBytes();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.BYTES);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not array of bytes.- See Also:
-
isText
T isText()Verifies that the value is a text.Example where the assertion verifies that the value in the
Columncalled "title" of the firstRowof theTableis a text :assertThat(table).row().value("title").isText();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis a text :assertThat(changes).change().rowAtEndPoint().value().isText();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.TEXT);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not text.- See Also:
-
isUUID
T isUUID()Verifies that the value is an UUID.Example where the assertion verifies that the value in the
Columncalled id of the firstRowof theTableis an UUID :assertThat(table).row().value("id").isUUID();Example where the assertion verifies that the value in the first
Columnof theRowat end point of the firstChangeis an UUID :assertThat(changes).change().rowAtEndPoint().value().isUUID();This assertion method is equivalent to :
xxxxx.isOfType(ValueType.UUID);- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the value is not UUID.- Since:
- 1.1.0
- See Also:
-