@Override
    public String getTaskExecutionBody(TaskConfig config, TaskExecutionContext taskExecutionContext) {
        Map requestBody = new HashMap();
        Map contextMap = new HashMap();
        contextMap.put("environmentVariables", taskExecutionContext.environment().asMap());
        contextMap.put("workingDirectory", taskExecutionContext.workingDir());
        requestBody.put("context", contextMap);
        requestBody.put("config", configPropertiesAsMap(config));
        return new Gson().toJson(requestBody);

    }
@Test
    public void shouldReturnRequestBodyForTaskExecution() {
        TaskExecutionContext context = mock(TaskExecutionContext.class);
        String workingDir = "working-dir";
        TaskConfig config = new TaskConfig();
        config.add(new TaskConfigProperty("Property1", "Value1"));
        config.add(new TaskConfigProperty("Property2", "Value2"));

        when(context.workingDir()).thenReturn(workingDir);
        when(context.environment()).thenReturn(getEnvironmentVariables());

        String requestBody = new JsonBasedTaskExtensionHandler_V1().getTaskExecutionBody(config, context);
        Map result = (Map) new GsonBuilder().create().fromJson(requestBody, Object.class);
        Map taskExecutionContextFromRequest = (Map) result.get("context");

        assertThat(taskExecutionContextFromRequest.get("workingDirectory"), is(workingDir));
        Map environmentVariables = (Map) taskExecutionContextFromRequest.get("environmentVariables");
        assertThat(environmentVariables.size(), is(2));
        assertThat(environmentVariables.get("ENV1").toString(), is("VAL1"));
        assertThat(environmentVariables.get("ENV2").toString(), is("VAL2"));

        Map<String,Object> taskConfigMap = (Map<String,Object>) result.get("config");

        assertThat(taskConfigMap.size(), is(2));
        Map property1 = (Map) taskConfigMap.get("Property1");
        Map property2 = (Map) taskConfigMap.get("Property2");
        assertThat(property1.get("value").toString(), is("Value1"));
        assertThat(property2.get("value").toString(), is("Value2"));
    }