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 shouldJSONizeElasticAgentStatusReportRequestBodyWhenJobIdentifierIsProvided() throws Exception {
        String actual = new ElasticAgentExtensionConverterV5().getAgentStatusReportRequestBody(jobIdentifier, null, clusterProfile);
        String expected = """
                {  "job_identifier": {
                    "pipeline_name": "test-pipeline",
                    "pipeline_counter": 1,
                    "pipeline_label": "Test Pipeline",
                    "stage_name": "test-stage",
                    "stage_counter": "1",
                    "job_name": "test-job",
                    "job_id": 100
                  },
                "cluster_profile_properties":  {     "key":"value"  }}""";

        assertThatJson(expected).isEqualTo(actual);
    }