diff --git a/neo4j/example/src/main/java/example/springdata/neo4j/ActorRepository.java b/neo4j/example/src/main/java/example/springdata/neo4j/ActorRepository.java index aa87f273..f72d6b15 100644 --- a/neo4j/example/src/main/java/example/springdata/neo4j/ActorRepository.java +++ b/neo4j/example/src/main/java/example/springdata/neo4j/ActorRepository.java @@ -26,9 +26,11 @@ import org.springframework.data.neo4j.repository.Neo4jRepository; * @author Michael J. Simons */ public interface ActorRepository extends Neo4jRepository { + /** - * Nested property from select from roles -> movie -> title, - * where this here represents the start node in a relationship and movie the end node. + * Nested property from select from roles -> movie -> title, where this here represents the start node in a + * relationship and movie the end node. + * * @param title * @return */ diff --git a/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java b/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java index ac63790a..9f6105d9 100644 --- a/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java +++ b/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java @@ -27,7 +27,7 @@ import org.springframework.boot.SpringBootVersion; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.util.Version; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ClassUtils; @@ -38,14 +38,13 @@ import org.springframework.util.ClassUtils; * @author Oliver Gierke * @author Michael J. Simons */ -@RunWith(SpringJUnit4ClassRunner.class) +@RunWith(SpringRunner.class) @SpringBootTest @Transactional public class ActorRepositoryIntegrationTest { @SpringBootApplication - static class ExampleConfig { - } + static class ExampleConfig {} @Autowired ActorRepository actorRepository; @@ -62,7 +61,7 @@ public class ActorRepositoryIntegrationTest { assertThat(actorRepository.findById(daniel.getId())).hasValueSatisfying(actor -> { assertThat(actor.getName()).isEqualTo(daniel.getName()); assertThat(actor.getRoles()).hasSize(1).first() - .satisfies(role -> assertThat(role.getRole()).isEqualTo("Harry Potter")); + .satisfies(role -> assertThat(role.getRole()).isEqualTo("Harry Potter")); }); } @@ -87,17 +86,16 @@ public class ActorRepositoryIntegrationTest { actorRepository.save(nealMcDonough); assertThat(actorRepository.findAllByRolesMovieTitle(iKnowWhoKilledMe.getTitle())).hasSize(2) - .extracting(Actor::getName).contains(lindsayLohan.getName(), nealMcDonough.getName()); + .extracting(Actor::getName).contains(lindsayLohan.getName(), nealMcDonough.getName()); } private static boolean thatSupportForNestedPropertiesIsAvailable() { Version minVersion = Version.parse("2.0.5"); - Optional currentSpringBootVersion = Optional.ofNullable(SpringBootVersion.getVersion()); - return currentSpringBootVersion.map(Version::parse) - .map(v -> v.isGreaterThanOrEqualTo(minVersion)) - .orElseGet(ActorRepositoryIntegrationTest::fallBackToVersionSpecificClasses); + return Optional.ofNullable(SpringBootVersion.getVersion()).map(Version::parse) // + .map(v -> v.isGreaterThanOrEqualTo(minVersion)) // + .orElseGet(ActorRepositoryIntegrationTest::fallBackToVersionSpecificClasses); } private static boolean fallBackToVersionSpecificClasses() { @@ -107,7 +105,7 @@ public class ActorRepositoryIntegrationTest { String fqnBoot210Class = "org.springframework.boot.autoconfigure.insight.InsightsProperties"; String fqnBoot205Class = "org.springframework.boot.autoconfigure.security.servlet.RequestMatcherProvider"; - return ClassUtils.isPresent(fqnBoot210Class, usedClassLoader) || ClassUtils - .isPresent(fqnBoot205Class, usedClassLoader); + return ClassUtils.isPresent(fqnBoot210Class, usedClassLoader) // + || ClassUtils.isPresent(fqnBoot205Class, usedClassLoader); } }