DATACMNS-1005 - Polishing.
Simplified type check by using Set as method signature to avoid unnecessary manual array wrapping. Simplification in the test assertions. A bit of Javadoc, corrected imports and author tags. Original pull request: #200.
This commit is contained in:
@@ -46,6 +46,7 @@ import org.springframework.data.util.Version;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Maciek Opała
|
||||
*/
|
||||
public class QueryMethodUnitTests {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.repository.util;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.data.repository.util.QueryExecutionConverters.*;
|
||||
|
||||
@@ -41,10 +41,13 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Slice;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
|
||||
@@ -55,6 +58,7 @@ import com.google.common.base.Optional;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author Maciek Opała
|
||||
*/
|
||||
public class QueryExecutionConvertersUnitTests {
|
||||
|
||||
@@ -273,11 +277,8 @@ public class QueryExecutionConvertersUnitTests {
|
||||
@Test // DATACMNS-1005
|
||||
public void registersAllowedPageabletypes() {
|
||||
|
||||
final Set<Class<?>> allowedPageableTypes = QueryExecutionConverters.getAllowedPageableTypes();
|
||||
assertThat(allowedPageableTypes, hasItem(Page.class));
|
||||
assertThat(allowedPageableTypes, hasItem(Slice.class));
|
||||
assertThat(allowedPageableTypes, hasItem(List.class));
|
||||
assertThat(allowedPageableTypes, hasItem(Seq.class));
|
||||
Set<Class<?>> allowedPageableTypes = QueryExecutionConverters.getAllowedPageableTypes();
|
||||
assertThat(allowedPageableTypes, Matchers.<Class<?>> hasItems(Page.class, Slice.class, List.class, Seq.class));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user