Forum Discussion
- RadfordSuper Contributor
I think it is because you variable "ActualschoolList" is an empty Groovy List object, but your variable "ExpectedchoolList" is the literal string "[]" these are two different things, thus the assertion fails. If you are expecting an emty list, try defining "ExpectedchoolList" as follows:
def ExpectedchoolList = []
See the following page for more info on working with lists:
http://docs.groovy-lang.org/next/html/documentation/working-with-collections.html#Collections-Lists
- HimanshuTayalCommunity Hero
Hi chathurad,
Instead of doing [] == [], match the size if you don't want to assert on the items inside your List.
try using
assert (actualList.size() == expectedList.size()) : "Size not equal"
Click "Accept as Solution" if my answer has helped, and remember to give "kudos" :)
Regards,
Himanshu Tayal
Related Content
- 9 years ago
Recent Discussions
- 14 hours ago