diff --git a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java index 354b551a3..c88434207 100644 --- a/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java +++ b/src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java @@ -61,13 +61,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 ASYNC_RESULT_PRESENT = ClassUtils.isPresent( - "org.springframework.scheduling.annotation.AsyncResult", 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", @@ -100,7 +93,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()); UNWRAPPER_TYPES.add(NullableWrapperToCompletableFutureConverter.getWrapperType()); } @@ -189,9 +182,7 @@ public abstract class QueryExecutionConverters { conversionService.addConverter(new NullableWrapperToJavaSlangOptionConverter(conversionService)); } - if (ASYNC_RESULT_PRESENT) { - conversionService.addConverter(new NullableWrapperToFutureConverter(conversionService)); - } + conversionService.addConverter(new NullableWrapperToFutureConverter(conversionService)); } /** @@ -519,7 +510,7 @@ public abstract class QueryExecutionConverters { * * @author Oliver Gierke * @author Mark Paluch - * @author 1.13 + * @since 1.12 */ private static enum ScalOptionUnwrapper implements Converter { diff --git a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java index bb19c2be4..5f1d2b2c0 100644 --- a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java @@ -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 reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -33,9 +32,7 @@ import java.util.concurrent.Future; import org.junit.Before; import org.junit.Test; import org.reactivestreams.Publisher; -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; @@ -49,9 +46,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 @@ -131,9 +125,6 @@ public class QueryExecutionConvertersUnitTests { */ @Test public void registersCompletableFutureAsWrapperTypeOnSpring42OrBetter() { - - assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); - assertThat(QueryExecutionConverters.supports(CompletableFuture.class), is(true)); }