use of org.apache.kafka.connect.data.Timestamp in project ksql by confluentinc.
the class KsqlJsonDeserializerTest method shouldThrowIfCanNotCoerceToTimestamp.
@Test
public void shouldThrowIfCanNotCoerceToTimestamp() {
// Given:
final KsqlJsonDeserializer<java.sql.Timestamp> deserializer = givenDeserializerForSchema(Timestamp.SCHEMA, java.sql.Timestamp.class);
final byte[] bytes = serializeJson(BooleanNode.valueOf(true));
// When:
final Exception e = assertThrows(SerializationException.class, () -> deserializer.deserialize(SOME_TOPIC, bytes));
// Then:
assertThat(e.getCause(), (hasMessage(startsWith("Can't convert type. sourceType: BooleanNode, requiredType: TIMESTAMP"))));
}
Aggregations