pact-jvm

Pact Dsl - provider returning more records than in pact file

こ雲淡風輕ζ 提交于 2019-12-23 03:34:11
问题 I have the following classes:- public class Student { private String id; private String firstName; private String lastName; private int age; } public class DepartmentResponse { private String id; private String name; List<Student> students; } At Consumer side, I have the LamdaDsl as below: @Pact(consumer = "StudentServiceConsumer1") public RequestResponsePact createPact(PactDslWithProvider builder) { Map<String, String> headers = new HashMap(); headers.put("Content-Type", "application/json");

Pact Groovy Mock with Array in Body

余生颓废 提交于 2019-12-11 07:25:49
问题 I would like to model my much such that its body consists of an array of n elements. The below code only creates one element in the array, when it should produce three. withBody(eachLike(3, { id identifier state("COMPLETED") type regexp("(A|B)", "A") })) Oddly enough, if I name the name collection, it actually generates three objects: withBody { namedObject eachLike(3, { id identifier }) } Where do I go wrong? Is this a bug? 来源: https://stackoverflow.com/questions/46523414/pact-groovy-mock