DATAREST-1261 - Fixed invalid fallback to default delegate in UnwrappingRepositoryInvoker.invokeFindById(…).

Previously we fell back to the default by-id lookup even if a custom entity lookup was defined but returned an empty result.
This commit is contained in:
Oliver Gierke
2018-07-12 22:36:56 +02:00
parent 429706a77e
commit 781e1affe2
2 changed files with 5 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ public class UnwrappingRepositoryInvokerFactoryUnitTests {
});
}
@Test // DATAREST-724
@Test // DATAREST-724, DATAREST-1261
@SuppressWarnings("unchecked")
public void usesRegisteredEntityLookup() {
@@ -89,6 +89,7 @@ public class UnwrappingRepositoryInvokerFactoryUnitTests {
factory.getInvokerFor(Profile.class).invokeFindById(1L);
verify(lookup, times(1)).lookupEntity(eq(1L));
verify(invoker, never()).invokeFindById(eq(1L)); // DATAREST-1261
}
private static Consumer<AbstractOptionalAssert<?, Object>> $(Consumer<AbstractOptionalAssert<?, Object>> consumer) {