I would like to test if the elements in a list are in a particular order. Specifically I would like to test for a member of the elements. So something like:
assertThat(listOfObjects).hasProperty(name).inOrder("one", "two", "three");
Is is possible to do something like this ? Right now I manually iterate over the elements and have an assertion for each one.
Having a quick browse though the version 1 source code (link here) I found this method which claims to be doing what you want:
If I'm understanding the Javadoc correctly, you would just do this:
Note though that there were some issues with this method in version 2.0-M8. As detailed here! They were resolved in version 2.0-M9.