test_class.file: support-metrics-client/src/test/java/io/confluent/support/metrics/serde/AvroSerializerTest.java
test_class.identifier: AvroSerializerTest
test_case.body: @Test
    public void testSerializedDataIncludesAvroSchema() throws IOException {
      // Given
      GenericContainer anyValidRecord = new User("anyName");
      AvroDeserializer decoder = new AvroDeserializer();
      AvroSerializer encoder = new AvroSerializer();
  
      // When
      byte[] serializedRecord = encoder.serialize(anyValidRecord);
  
      // Then
      GenericContainer[] decodedRecords =
          decoder.deserialize(anyValidRecord.getSchema(), serializedRecord);
      assertThat(decodedRecords.length).isEqualTo(1);
      assertThat(anyValidRecord.getSchema()).isEqualTo(decodedRecords[0].getSchema());
    }
test_case.class_method_signature: AvroSerializerTest.testSerializedDataIncludesAvroSchema()
test_case.full_signature: @Test public void testSerializedDataIncludesAvroSchema()
test_case.identifier: testSerializedDataIncludesAvroSchema
test_case.invocations: serialize deserialize getSchema isEqualTo assertThat isEqualTo assertThat getSchema getSchema
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSerializedDataIncludesAvroSchema()
focal_class.file: support-metrics-client/src/main/java/io/confluent/support/metrics/serde/AvroSerializer.java
focal_class.identifier: AvroSerializer
focal_class.class_method_signature: AvroSerializer.serialize(GenericContainer record)
focal_class.full_signature: public byte[] serialize(GenericContainer record)
focal_class.identifier: serialize
focal_class.modifiers: public
focal_class.parameters: (GenericContainer record)
focal_class.return: byte[]
focal_class.signature: byte[] serialize(GenericContainer record)
focal_method.body: public byte[] serialize(GenericContainer record) throws IOException {
      if (record != null) {
        DatumWriter<GenericContainer> datumWriter = new GenericDatumWriter<>(record.getSchema());
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataFileWriter<GenericContainer> writer = new DataFileWriter<>(datumWriter);
        writer.create(record.getSchema(), out);
        writer.append(record);
        writer.close();
        out.close();
        return out.toByteArray();
      } else {
        return null;
      }
    }
focal_method.class_method_signature: AvroSerializer.serialize(GenericContainer record)
focal_method.full_signature: public byte[] serialize(GenericContainer record)
focal_method.identifier: serialize
focal_method.invocations: getSchema create getSchema append close close toByteArray
focal_method.modifiers: public
focal_method.parameters: (GenericContainer record)
focal_method.return: byte[]
focal_method.signature: byte[] serialize(GenericContainer record)