Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to verify Descending order with assertJ assertions? #1326

Closed
siva90144 opened this issue Sep 17, 2018 · 3 comments
Closed

how to verify Descending order with assertJ assertions? #1326

siva90144 opened this issue Sep 17, 2018 · 3 comments

Comments

@siva90144
Copy link

Hi,

I have a scenario as below.
arrayList countryList =new arrayList();
I have taken arrayList and added all countries to it . Now I need to verify those are in ascending/Descending order or not.
//working fine for Ascending order.
assertThat(sortAscending(countryList)).as("Ascending Sorted order is: "+countryList).isSorted();

is there is a way to verify for Descending order with assertJ. I have seen "isSortedAccordingTo" . it is using comparator. But in my implementation there is no comparator(it is not required for me to implement comparator).

is any other assert will verfiy Descending order? any example with it ?

Thanks in advance for your help.

@joel-costigliola
Copy link
Member

is that the same issue as assertj/assertj-examples#43 ?

@siva90144
Copy link
Author

Yes Joel. Its extension to that

@joel-costigliola
Copy link
Member

the only option at the moment is to use isSortedAccordingTo and define your reverse comparator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants