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-with-array-in-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!