Polishing.

Fix backport to be Java 1.8 compatible.

See #2869
This commit is contained in:
Mark Paluch
2023-07-03 14:51:49 +02:00
parent 961a2386c7
commit 594da202d9
3 changed files with 18 additions and 16 deletions

View File

@@ -19,9 +19,9 @@ import static org.assertj.core.api.Assertions.*;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.stream.Stream;
@@ -121,13 +121,14 @@ class AbstractRepositoryMetadataUnitTests {
Stream<DynamicTest> detectsReturnTypesForStreamableAggregates() throws Exception {
RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(StreamableAggregateRepository.class);
Stream<Entry<String, Class<?>>> methods = Stream.of(
Map.entry("findBy", StreamableAggregate.class),
Map.entry("findSubTypeBy", StreamableAggregateSubType.class),
Map.entry("findAllBy", StreamableAggregate.class),
Map.entry("findOptional", StreamableAggregate.class));
return DynamicTest.stream(methods, //
Map<String, Class<?>> map = new LinkedHashMap<>();
map.put("findBy", StreamableAggregate.class);
map.put("findSubTypeBy", StreamableAggregateSubType.class);
map.put("findAllBy", StreamableAggregate.class);
map.put("findOptionalBy", StreamableAggregate.class);
return DynamicTest.stream(map.entrySet().stream(), //
it -> it.getKey() + "'s returned domain class is " + it.getValue(), //
it -> {
@@ -190,7 +191,7 @@ class AbstractRepositoryMetadataUnitTests {
Streamable<StreamableAggregate> findAllBy();
Optional<StreamableAggregate> findOptional();
Optional<StreamableAggregate> findOptionalBy();
}
static abstract class StreamableAggregateSubType extends StreamableAggregate {}

View File

@@ -23,9 +23,9 @@ import reactor.core.publisher.Mono;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
@@ -269,13 +269,14 @@ class QueryMethodUnitTests {
throws Exception {
RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(StreamableAggregateRepository.class);
Stream<Entry<String, Boolean>> stream = Stream.of(
Map.entry("findBy", false),
Map.entry("findSubTypeBy", false),
Map.entry("findAllBy", true),
Map.entry("findOptionalBy", false));
return DynamicTest.stream(stream, //
Map<String, Boolean> map = new LinkedHashMap<>();
map.put("findBy", false);
map.put("findSubTypeBy", false);
map.put("findAllBy", true);
map.put("findOptionalBy", false);
return DynamicTest.stream(map.entrySet().stream(), //
it -> it.getKey() + " considered collection query -> " + it.getValue(), //
it -> {

View File

@@ -26,7 +26,7 @@ import kotlin.reflect.jvm.javaMethod
*
* @author Mark Paluch
*/
class ParameterUnitTests {
class ParameterKtUnitTests {
@Test // DATACMNS-1508
fun `should consider Continuation a special parameter`() {