DATACMNS-436 - Order.equals(…) / hashCode() / toString() now consider ignore case flag.

Extended equals(…), hashCode() and toString() methods t consider the ignore case flag held in an Order instance.
This commit is contained in:
Oliver Gierke
2014-02-06 18:13:54 +01:00
parent 899cf25330
commit 1e3640e0ee
2 changed files with 19 additions and 2 deletions

View File

@@ -117,4 +117,17 @@ public class SortUnitTests {
public void orderDoesNotIgnoreCaseByDefault() {
assertThat(new Order(Direction.ASC, "foo").isIgnoreCase(), is(false));
}
/**
* @see DATACMNS-436
*/
@Test
public void ordersWithDifferentIgnoreCaseDoNotEqual() {
Order foo = new Order("foo");
Order fooIgnoreCase = new Order("foo").ignoreCase();
assertThat(foo, is(not(fooIgnoreCase)));
assertThat(foo.hashCode(), is(not(fooIgnoreCase.hashCode())));
}
}