String getAgentStatusReportRequestBody(JobIdentifier identifier, String elasticAgentId, Map<String, String> clusterProfile) {
        JsonObject jsonObject = new JsonObject();
        if (identifier != null) {
            jsonObject.add("job_identifier", jobIdentifierJson(identifier));
        }
        jsonObject.add("cluster_profile_properties", mapToJsonObject(clusterProfile));
        jsonObject.addProperty("elastic_agent_id", elasticAgentId);
        return FORCED_EXPOSE_GSON.toJson(jsonObject);
    }
@Test
    public void shouldJSONizeElasticAgentStatusReportRequestBodyWhenElasticAgentIdIsProvided() throws Exception {
        String elasticAgentId = "my-fancy-elastic-agent-id";
        String actual = new ElasticAgentExtensionConverterV5().getAgentStatusReportRequestBody(null, elasticAgentId, clusterProfile);
        String expected = format("{" +
                "\"cluster_profile_properties\":{" +
                "   \"key\":\"value\"" +
                "   }," +
                "  \"elastic_agent_id\": \"%s\"" +
                "}", elasticAgentId);

        assertThatJson(expected).isEqualTo(actual);
    }