@Override
    public String convertTaskConfigToJson(TaskConfig taskConfig) {
        return new Gson().toJson(configPropertiesAsMap(taskConfig));
    }
@Test
    public void shouldConvertTaskConfigObjectToJson() {
        TaskConfig taskConfig = new TaskConfig();
        TaskConfigProperty p1 = new TaskConfigProperty("k1", "value1");
        p1.with(Property.SECURE, true);
        p1.with(Property.REQUIRED, true);

        TaskConfigProperty p2 = new TaskConfigProperty("k2", "value2");
        p2.with(Property.SECURE, false);
        p2.with(Property.REQUIRED, true);

        taskConfig.add(p1);
        taskConfig.add(p2);

        String json = new JsonBasedTaskExtensionHandler_V1().convertTaskConfigToJson(taskConfig);
        Map taskConfigMap = (Map) new GsonBuilder().create().fromJson(json, Object.class);

        Map property1 = (Map) taskConfigMap.get("k1");
        assertThat(property1.get("value").toString(), is("value1"));
        assertThat(property1.get("secure"), is(true));
        assertThat(property1.get("required"), is(true));

        Map property2 = (Map) taskConfigMap.get("k2");
        assertThat(property2.get("value").toString(), is("value2"));
        assertThat(property2.get("secure"), is(false));
        assertThat(property2.get("required"), is(true));
    }