@Test
public void testWriteDocsForConsumeKafkaRecord() throws IOException {

    final File rawExtensionJson = new File("src/test/resources/extensions/ConsumeKafkaRecord_1_0.json");
    final String serializedExtension = getSerializedExtension(rawExtensionJson);
    final ExtensionEntity entity = new ExtensionEntity();
    entity.setContent(serializedExtension);
    entity.setBucketId(UUID.randomUUID().toString());
    entity.setBucketName("My Bucket");
    entity.setGroupId("org.apache.nifi");
    entity.setArtifactId("nifi-kakfa-bundle");
    entity.setVersion("1.9.1");
    entity.setSystemApiVersion("1.9.1");
    entity.setBundleId(UUID.randomUUID().toString());
    entity.setBundleType(BundleType.NIFI_NAR);
    entity.setDisplayName("ConsumeKafkaRecord_1_0");
    final ExtensionMetadata metadata = ExtensionMappings.mapToMetadata(entity, extensionSerializer);
    assertNotNull(entity);
    final Extension extension = ExtensionMappings.map(entity, extensionSerializer);
    assertNotNull(extension);
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    docWriter.write(metadata, extension, out);
    final String docsResult = new String(out.toByteArray(), StandardCharsets.UTF_8);
    assertNotNull(docsResult);
    XmlValidator.assertXmlValid(docsResult);
    XmlValidator.assertContains(docsResult, entity.getDisplayName());
}