#206 - Added more projection examples in JPA.

Added another one that shows projections can be wrapped into an Optional.
This commit is contained in:
Oliver Gierke
2016-08-18 15:36:01 +02:00
parent 7519f8e385
commit 34fe9d2720
2 changed files with 14 additions and 0 deletions

View File

@@ -134,4 +134,9 @@ public class CustomerRepositoryIntegrationTest {
assertThat(page.getContent().get(0).getFirstname(), is("Carter"));
}
@Test
public void appliesProjectionToOptional() {
assertThat(customers.findOptionalProjectionByLastname("Beauford").isPresent(), is(true));
}
}