Pact Groovy Mock with Array in Body

2019-08-11 19:16发布

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?

0条回答
登录 后发表回答