@VisibleForTesting
    static String generateFile(String template, QualifiedVersion version, Set<ChangelogEntry> changelogs) throws IOException {
        final var changelogsByTypeByArea = buildChangelogBreakdown(changelogs);

        final Map<String, Object> bindings = new HashMap<>();
        bindings.put("version", version);
        bindings.put("changelogsByTypeByArea", changelogsByTypeByArea);
        bindings.put("TYPE_LABELS", TYPE_LABELS);

        return TemplateUtils.render(template, bindings);
    }
@Test
    public void generateFile_rendersCorrectMarkup() throws Exception {
        // given:
        final String template = getResource("/templates/release-notes.asciidoc");
        final String expectedOutput = getResource(
            "/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.generateFile.asciidoc"
        );

        final Set<ChangelogEntry> entries = getEntries();

        // when:
        final String actualOutput = ReleaseNotesGenerator.generateFile(template, QualifiedVersion.of("8.2.0-SNAPSHOT"), entries);

        // then:
        assertThat(actualOutput, equalTo(expectedOutput));
    }