use of io.confluent.ksql.serde.SchemaTranslator in project ksql by confluentinc.
the class SchemaRegistryTopicSchemaSupplierTest method setUp.
@Before
public void setUp() throws Exception {
supplier = new SchemaRegistryTopicSchemaSupplier(srClient, f -> format);
when(srClient.getLatestSchemaMetadata(any())).thenReturn(new SchemaMetadata(SCHEMA_ID, -1, AVRO_SCHEMA));
when(srClient.getSchemaBySubjectAndId(any(), anyInt())).thenReturn(parsedSchema);
when(parsedSchema.schemaType()).thenReturn(AvroSchema.TYPE);
when(parsedSchema.canonicalString()).thenReturn(AVRO_SCHEMA);
when(format.getSchemaTranslator(any())).thenReturn(schemaTranslator);
when(format.getSchemaTranslator(any(), any())).thenReturn(schemaTranslator);
when(schemaTranslator.toColumns(eq(parsedSchema), any(), anyBoolean())).thenReturn(ImmutableList.of(column1));
when(schemaTranslator.name()).thenReturn("AVRO");
when(expectedFormat.getProperties()).thenReturn(formatProperties);
}
Aggregations