DATACMNS-937 - Polishing.
Removed Spring 4.2 guard from QueryExecutionConverter and its unit tests.
This commit is contained in:
@@ -59,10 +59,6 @@ import com.google.common.base.Optional;
|
||||
*/
|
||||
public abstract class QueryExecutionConverters {
|
||||
|
||||
private static final boolean SPRING_4_2_PRESENT = ClassUtils.isPresent(
|
||||
"org.springframework.core.annotation.AnnotationConfigurationException",
|
||||
QueryExecutionConverters.class.getClassLoader());
|
||||
|
||||
private static final boolean GUAVA_PRESENT = ClassUtils.isPresent("com.google.common.base.Optional",
|
||||
QueryExecutionConverters.class.getClassLoader());
|
||||
private static final boolean JDK_8_PRESENT = ClassUtils.isPresent("java.util.Optional",
|
||||
@@ -90,7 +86,7 @@ public abstract class QueryExecutionConverters {
|
||||
UNWRAPPERS.add(Jdk8OptionalUnwrapper.INSTANCE);
|
||||
}
|
||||
|
||||
if (JDK_8_PRESENT && SPRING_4_2_PRESENT) {
|
||||
if (JDK_8_PRESENT) {
|
||||
WRAPPER_TYPES.add(NullableWrapperToCompletableFutureConverter.getWrapperType());
|
||||
}
|
||||
|
||||
@@ -480,7 +476,7 @@ public abstract class QueryExecutionConverters {
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author 1.13
|
||||
* @since 1.12
|
||||
*/
|
||||
private static enum ScalOptionUnwrapper implements Converter<Object, Object> {
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.data.repository.util;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assume.*;
|
||||
|
||||
import scala.Option;
|
||||
|
||||
@@ -27,9 +26,7 @@ import java.util.concurrent.Future;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.SpringVersion;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.data.util.Version;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
|
||||
@@ -43,9 +40,6 @@ import com.google.common.base.Optional;
|
||||
*/
|
||||
public class QueryExecutionConvertersUnitTests {
|
||||
|
||||
private static final Version SPRING_VERSION = Version.parse(SpringVersion.getVersion());
|
||||
private static final Version FOUR_DOT_TWO = new Version(4, 2);
|
||||
|
||||
DefaultConversionService conversionService;
|
||||
|
||||
@Before
|
||||
@@ -74,9 +68,6 @@ public class QueryExecutionConvertersUnitTests {
|
||||
*/
|
||||
@Test
|
||||
public void registersCompletableFutureAsWrapperTypeOnSpring42OrBetter() {
|
||||
|
||||
assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true));
|
||||
|
||||
assertThat(QueryExecutionConverters.supports(CompletableFuture.class), is(true));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user