@Override
    public String publishArtifactMessage(ArtifactPlan artifactPlan, ArtifactStore artifactStore, String agentWorkingDirectory,
                                         Map<String, String> environmentVariables) {
        final Map<String, Object> messageObject = new HashMap<>();
        messageObject.put("artifact_store", getArtifactStore(artifactStore));
        messageObject.put("artifact_plan", artifactPlan.getPluggableArtifactConfiguration());
        messageObject.put("agent_working_directory", agentWorkingDirectory);
        messageObject.put("environment_variables", environmentVariables);
        return NULLS_GSON.toJson(messageObject);
    }
@Test
    public void publishArtifactMessage_shouldSerializeToJson() {
        final ArtifactMessageConverterV2 converter = new ArtifactMessageConverterV2();
        final ArtifactStore artifactStore = new ArtifactStore("s3-store", "pluginId", create("Foo", false, "Bar"));
        final ArtifactPlan artifactPlan = new ArtifactPlan(new PluggableArtifactConfig("installers", "s3-store", create("Baz", true, "Car")));
        final Map<String, String> environmentVariables = new HashMap<>();
        environmentVariables.put("foo", "bar");
        final String publishArtifactMessage = converter.publishArtifactMessage(artifactPlan, artifactStore, "/temp", environmentVariables);

        final String expectedStr = "{" +
                "  \"artifact_plan\": {" +
                "    \"configuration\": {" +
                "      \"Baz\": \"Car\"" +
                "    }," +
                "    \"id\": \"installers\"," +
                "    \"storeId\": \"s3-store\"" +
                "  }," +
                "  \"artifact_store\": {" +
                "    \"configuration\": {" +
                "      \"Foo\": \"Bar\"" +
                "    }," +
                "    \"id\": \"s3-store\"" +
                "  }," +
                "  \"agent_working_directory\": \"/temp\"," +
                "  \"environment_variables\": {" +
                "       \"foo\": \"bar\"" +
                "   }" +
                "}";

        assertThatJson(expectedStr).isEqualTo(publishArtifactMessage);
    }