use of io.confluent.ksql.logging.processing.DeserializationError in project ksql by confluentinc.
the class StaticTopicSerdeTest method shouldLogOriginalFailureIfBothFail.
@Test
public void shouldLogOriginalFailureIfBothFail() {
// Given:
when(delegateD.deserialize(Mockito.any(), Mockito.any())).thenThrow(new RuntimeException());
final ProcessingLogger logger = mock(ProcessingLogger.class);
final LoggingDeserializer<Object> loggingDelegate = new LoggingDeserializer<>(delegateD, logger);
final Serde<Object> delegate = new WrapperSerde<>(delegateS, loggingDelegate);
staticSerde = StaticTopicSerde.wrap(STATIC_TOPIC, delegate, callback);
// When:
final RuntimeException err = assertThrows(RuntimeException.class, () -> staticSerde.deserializer().deserialize(SOURCE_TOPIC, SOME_BYTES));
// Then:
verify(logger).error(new DeserializationError(err, Optional.of(SOME_BYTES), STATIC_TOPIC, false));
verifyNoMoreInteractions(callback);
}
Aggregations