use of io.confluent.ksql.schema.ksql.inference.TopicSchemaSupplier.SchemaResult in project ksql by confluentinc.
the class SchemaRegistryTopicSchemaSupplierTest method shouldReturnErrorFromGetValueWithIdSchemaIfNotFound.
@Test
public void shouldReturnErrorFromGetValueWithIdSchemaIfNotFound() throws Exception {
// Given:
when(srClient.getSchemaBySubjectAndId(any(), anyInt())).thenThrow(notFoundException());
// When:
final SchemaResult result = supplier.getValueSchema(Optional.of(TOPIC_NAME), Optional.of(42), expectedFormat, SerdeFeatures.of());
// Then:
assertThat(result.schemaAndId, is(Optional.empty()));
assertThat(result.failureReason, is(not(Optional.empty())));
verifyFailureMessageForValue(result, Optional.of(42));
}
Aggregations