I am fetching response in sorted order from Get call using "http am.com/au/v/so?sort=name". It fetches the results in sorted order. How can I assert the the name in the list is in alphabetical order.
List<String> list = new ArrayList<String>();
for (Aml aml : value.getResults()) {
name = aml.getName());
You can use something like this
String prev = "";
for(Ami ami : value.getResults())
{
String currentName = ami.getName();
if(prev.compareTo(currentName) > 0)
{
return false;
}
prev = currentName;
}
return true;