DATACMNS-867 - Update forward ported code.
Polished method lookup in DefaultRepositoryInformation using Optionals.firstNonEmpty(…). Optimized creation of JavaSlang's Option type as we don't have to rely on reflection to call static methods on interfaces on Java 8. AssertJ updates in corresponding tests.
This commit is contained in:
@@ -242,11 +242,11 @@ public class DefaultRepositoryInformationUnitTests {
|
||||
|
||||
RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class);
|
||||
RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class,
|
||||
customImplementation.getClass());
|
||||
Optional.of(customImplementation.getClass()));
|
||||
|
||||
Method method = FooRepository.class.getMethod("staticMethod");
|
||||
|
||||
assertThat(information.getQueryMethods(), not(hasItem(method)));
|
||||
assertThat(information.getQueryMethods()).doesNotContain(method);
|
||||
}
|
||||
|
||||
@Test // DATACMNS-939
|
||||
@@ -254,11 +254,11 @@ public class DefaultRepositoryInformationUnitTests {
|
||||
|
||||
RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class);
|
||||
RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class,
|
||||
customImplementation.getClass());
|
||||
Optional.of(customImplementation.getClass()));
|
||||
|
||||
Method method = FooRepository.class.getMethod("defaultMethod");
|
||||
|
||||
assertThat(information.getQueryMethods(), not(hasItem(method)));
|
||||
assertThat(information.getQueryMethods()).doesNotContain(method);
|
||||
}
|
||||
|
||||
@Test // DATACMNS-943
|
||||
|
||||
@@ -281,7 +281,7 @@ public class RepositoryFactorySupportUnitTests {
|
||||
|
||||
ObjectRepository repository = factory.getRepository(ObjectRepository.class, customImplementation);
|
||||
|
||||
assertThat(repository.staticMethodDelegate(), is(equalTo("OK")));
|
||||
assertThat(repository.staticMethodDelegate()).isEqualTo("OK");
|
||||
|
||||
verifyZeroInteractions(customImplementation);
|
||||
verifyZeroInteractions(backingRepo);
|
||||
|
||||
@@ -186,7 +186,7 @@ public class QueryExecutionConvertersUnitTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void turnsNullIntoJavaslangOption() {
|
||||
assertThat(conversionService.convert(new NullableWrapper(null), javaslang.control.Option.class))
|
||||
.isEqualTo(optionNone());
|
||||
.isEqualTo(javaslang.control.Option.none());
|
||||
}
|
||||
|
||||
@Test // DATACMNS-937
|
||||
|
||||
Reference in New Issue
Block a user