webtau
webtau copied to clipboard
containExactly missing Collection argument.
I was unable to use containExactly matcher given a body which is a list of json objects:
body.should(containExactly(payload));
I had to convert the collection to an array:
body.should(containExactly(payload.toArray()));
Please add a method that accepts a Collection as well as an array, similar to containAll
public static ContainAllMatcher containExactly(Collection<Object> expected) {
return new ContainExactlyMatcher(expected);
}
This makes a lot of sense, thanks for the reporting!
Just noticed that containExactly doesn't work well with HTTP responses: it highlights nodes as incorrect in the output (using red **). Is this something you noticed as well @efrench-novi?
Also looks like the support for the list arg is in the pipeline to release already.
Yes I did notice that. If the order is not exactly the same, it will highlight the differences in red. However it looks like the tests still pass when that happens. It would be great id that could be fixed.
@efrench-novi 2.4 was released