@BeforeClass
  public static void setUp() {
    Map<String, String> config = Maps.newHashMap();
    config.put(AbstractKafkaAvroSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://localhost:8081");
    KafkaAvroSerializer avroSerializer = new KafkaAvroSerializer(new MockSchemaRegistryClient());
    avroSerializer.configure(config, false);
    simpleRecordConfluentBytes = avroSerializer.serialize("temp", simpleRecord);
  }
Use the KafkaAvroSerializer from Confluent to serialize the simpleRecord.
kafka-handler/src/test/org/apache/hadoop/hive/kafka/AvroBytesConverterTest.java