@Override
    public void run(DiagnosticsLogWriter writer) {
        writer.startSection("BuildInfo");
        writer.writeKeyValueEntry("Build", buildInfo.getBuild());
        // we convert to string to prevent formatting the number
        writer.writeKeyValueEntry("BuildNumber", "" + buildInfo.getBuildNumber());
        writer.writeKeyValueEntry("Revision", buildInfo.getRevision());
        BuildInfo upstreamBuildInfo = buildInfo.getUpstreamBuildInfo();
        if (upstreamBuildInfo != null) {
            writer.writeKeyValueEntry("UpstreamRevision", upstreamBuildInfo.getRevision());
        }
        writer.writeKeyValueEntry("Version", buildInfo.getVersion());
        writer.writeKeyValueEntry("SerialVersion", buildInfo.getSerializationVersion());
        writer.writeKeyValueEntry("Enterprise", buildInfo.isEnterprise());
        writer.endSection();
    }
@Test
    public void test() {
        plugin.run(logWriter);

        BuildInfo buildInfo = BuildInfoProvider.getBuildInfo();

        assertContains("BuildNumber=" + buildInfo.getBuildNumber());
        assertContains("Build=" + buildInfo.getBuild());
        assertContains("Revision=" + buildInfo.getRevision());
        assertContains("Version=" + buildInfo.getVersion());
        assertContains("SerialVersion=" + buildInfo.getSerializationVersion());
        assertContains("Enterprise=" + buildInfo.isEnterprise());
    }