### Question:
KafkaConsumerField { public Type getOutputType() { return outputType; } KafkaConsumerField();  KafkaConsumerField( KafkaConsumerField orig );  KafkaConsumerField( Name kafkaName, String outputName );  KafkaConsumerField( Name kafkaName, String outputName, Type outputType ); Name getKafkaName(); void setKafkaName( Name kafkaName ); String getOutputName(); void setOutputName( String outputName ); Type getOutputType(); void setOutputType( Type outputType );  }### Answer:
@Test public void testSerializersSet() throws Exception { field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name" ); assertEquals( "org.apache.kafka.common.serialization.StringSerializer", field.getOutputType().getKafkaSerializerClass() ); assertEquals( "org.apache.kafka.common.serialization.StringDeserializer", field.getOutputType().getKafkaDeserializerClass() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Integer ); assertEquals( "org.apache.kafka.common.serialization.LongSerializer", field.getOutputType().getKafkaSerializerClass() ); assertEquals( "org.apache.kafka.common.serialization.LongDeserializer", field.getOutputType().getKafkaDeserializerClass() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Binary ); assertEquals( "org.apache.kafka.common.serialization.ByteArraySerializer", field.getOutputType().getKafkaSerializerClass() ); assertEquals( "org.apache.kafka.common.serialization.ByteArrayDeserializer", field.getOutputType().getKafkaDeserializerClass() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Number ); assertEquals( "org.apache.kafka.common.serialization.DoubleSerializer", field.getOutputType().getKafkaSerializerClass() ); assertEquals( "org.apache.kafka.common.serialization.DoubleDeserializer", field.getOutputType().getKafkaDeserializerClass() ); }
@Test public void testSerializersSet() { field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name" ); assertEquals( "class org.apache.kafka.common.serialization.StringSerializer", field.getOutputType().getKafkaSerializerClass().toString() ); assertEquals( "class org.apache.kafka.common.serialization.StringDeserializer", field.getOutputType().getKafkaDeserializerClass().toString() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Integer ); assertEquals( "class org.apache.kafka.common.serialization.LongSerializer", field.getOutputType().getKafkaSerializerClass().toString() ); assertEquals( "class org.apache.kafka.common.serialization.LongDeserializer", field.getOutputType().getKafkaDeserializerClass().toString() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Binary ); assertEquals( "class org.apache.kafka.common.serialization.ByteArraySerializer", field.getOutputType().getKafkaSerializerClass().toString() ); assertEquals( "class org.apache.kafka.common.serialization.ByteArrayDeserializer", field.getOutputType().getKafkaDeserializerClass().toString() ); field = new KafkaConsumerField( KafkaConsumerField.Name.KEY, "Test Name", KafkaConsumerField.Type.Number ); assertEquals( "class org.apache.kafka.common.serialization.DoubleSerializer", field.getOutputType().getKafkaSerializerClass().toString() ); assertEquals( "class org.apache.kafka.common.serialization.DoubleDeserializer", field.getOutputType().getKafkaDeserializerClass().toString() ); }