Home » Java » Java Pact.io DSL for List of maps

Java Pact.io DSL for List of maps

Posted by: admin October 26, 2017 Leave a comment

Questions:

i have to create a pact dsl part to match the json to be serialized into the following java object:

List<Map<String, List<String>>> attributes = new ArrayList<>();

Currently i have following pact dsl part which is not working:

             .eachLike("attributes")
                .eachKeyMappedToAnArrayLike("sale")
                  .stringType("new sale")
                  .closeObject()
                .closeArray()
            .closeObject()
            .closeArray();

what’s the issue in the above pact dsl? i am following this github page to implement that:

https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-consumer-junit

Answers: