public static LambdaDslJsonArray newJsonArrayMaxLike(Integer size, Consumer<LambdaDslJsonArray> array) { final PactDslJsonArray pactDslJsonArray = new PactDslJsonArray("", "", null, true); pactDslJsonArray.setNumberExamples(1); pactDslJsonArray.getMatchers().addRule(new MaxTypeMatcher(size)); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(pactDslJsonArray); array.accept(dslArray); return dslArray; }
public static LambdaDslJsonArray newJsonArrayMinLike(Integer size, Consumer<LambdaDslJsonArray> array) { final PactDslJsonArray pactDslJsonArray = new PactDslJsonArray("", "", null, true); pactDslJsonArray.setNumberExamples(size); pactDslJsonArray.getMatchers().addRule(new MinTypeMatcher(size)); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(pactDslJsonArray); array.accept(dslArray); return dslArray; }
public static LambdaDslJsonArray newJsonArrayMinMaxLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> array) { final PactDslJsonArray pactDslJsonArray = new PactDslJsonArray("", "", null, true); pactDslJsonArray.setNumberExamples(minSize); pactDslJsonArray.getMatchers().addRule(new MinMaxTypeMatcher(minSize, maxSize)); final LambdaDslJsonArray dslArray = new LambdaDslJsonArray(pactDslJsonArray); array.accept(dslArray); return dslArray; }
/** * Closes the current array */ public DslPart closeArray() { if (parent != null) { parent.putArray(this); } else { getMatchers().applyMatcherRootPrefix("$"); getGenerators().applyRootPrefix("$"); } closed = true; return parent; }
/** * Closes the current array */ public DslPart closeArray() { if (parent != null) { parent.putArray(this); } else { getMatchers().applyMatcherRootPrefix("$"); getGenerators().applyRootPrefix("$"); } closed = true; return parent; }