DATACMNS-281 - Added support to Order for case insensitive sorts.
Modified the Order class to allow an ignore case flag to be set so that case insensitive sorts could be supported.
This commit is contained in:
committed by
Oliver Gierke
parent
b26f09f3b4
commit
a588f43857
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright 2008-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Copyright 2008-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.domain;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
@@ -21,11 +20,13 @@ import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.data.domain.Sort.Order;
|
||||
|
||||
/**
|
||||
* Unit test for {@link Sort}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Kevin Raymond
|
||||
*/
|
||||
public class SortUnitTests {
|
||||
|
||||
@@ -98,4 +99,22 @@ public class SortUnitTests {
|
||||
Sort sort = new Sort("foo").and(null);
|
||||
assertThat(sort, hasItem(new Sort.Order("foo")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-281
|
||||
* @author Kevin Raymond
|
||||
*/
|
||||
@Test
|
||||
public void configuresIgnoreCaseForOrder() {
|
||||
assertThat(new Order(Direction.ASC, "foo").ignoreCase().isIgnoreCase(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-281
|
||||
* @author Kevin Raymond
|
||||
*/
|
||||
@Test
|
||||
public void orderDoesNotIgnoreCaseByDefault() {
|
||||
assertThat(new Order(Direction.ASC, "foo").isIgnoreCase(), is(false));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user