@Test
public void testBuildWithMetadata(TestContext context) throws Exception {

    JoltSpec spec = JoltSpecBuilder.buildSpec(specValid, true);
    MultiMap headers = new VertxHttpHeaders();
    headers.add("x-abc", "x");
    headers.add("x-def", "y");
    headers.add("x-def", "y2");
    headers.add("x-ghi", "z");
    headers.add("x-ghi", "z2");
    headers.add("x-ghi", "z3");
    String builtInput = TransformPayloadInputBuilder.build(spec, SIMPLE_PAYLOAD, headers, matcher);
    String expected = "{\n" +
            "\t\"urlParts\": [\"/some/test/url\", \"url\"],\n" +
            "\t\"headers\": {\n" +
            "\t\t\"x-abc\": \"x\",\n" +
            "\t\t\"x-def\": \"y,y2\",\n" +
            "\t\t\"x-ghi\": \"z,z2,z3\"\n" +
            "\t},\n" +
            "\t\"payload\": {\n" +
            "\t\t\"key\": \"value\",\n" +
            "\t\t\"key2\": 344\n" +
            "\t}\n" +
            "}";
    context.assertEquals(new JsonObject(expected), new JsonObject(builtInput));
}