However, when configuration is changed to generate Spock tests, the following exception is thrown:
assertThat((java.lang.Iterable) parsedJson.read("\$.links", java.util.Collection.class)).as("\$.links").hasSizeBetween(one, five)
| | | | | | |
| | | | | 1 5
| | | | org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: org.assertj.core.api.ListAssert.hasSizeBetween() is applicable for argument types: (Integer, Integer) values: [1, 5]
The hasSizeBetween method accept's primitives:
public CollectionAssert hasSizeBetween(int lowerBound, int higherBound) {
isNotNull();
int size = size(this.actual);
if (!(size >= lowerBound && size <= higherBound)) {
failWithMessage("The size <%s> is not between <%s> and <%s>", size,
lowerBound, higherBound);
}
return this;
}
Guessing exception is related to Groovy's autoboxing.
The following matcher:
will generate the following assert:
This works fine under JUnit4.
However, when configuration is changed to generate Spock tests, the following exception is thrown:
The
hasSizeBetween
method accept's primitives:Guessing exception is related to Groovy's autoboxing.