diff --git a/jpa/java8/pom.xml b/jpa/java8/pom.xml index 5f97c95d..fe152d02 100644 --- a/jpa/java8/pom.xml +++ b/jpa/java8/pom.xml @@ -15,4 +15,5 @@ spring-data-jpa-java8 Spring Data JPA - Java 8 specific features + \ No newline at end of file diff --git a/jpa/java8/src/main/java/example/springdata/jpa/java8/Customer.java b/jpa/java8/src/main/java/example/springdata/jpa/java8/Customer.java index 05f47919..2b748b48 100644 --- a/jpa/java8/src/main/java/example/springdata/jpa/java8/Customer.java +++ b/jpa/java8/src/main/java/example/springdata/jpa/java8/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/java8/src/test/java/example/springdata/jpa/java8/Java8IntegrationTests.java b/jpa/java8/src/test/java/example/springdata/jpa/java8/Java8IntegrationTests.java index 2e59c7a9..f87f1eb0 100644 --- a/jpa/java8/src/test/java/example/springdata/jpa/java8/Java8IntegrationTests.java +++ b/jpa/java8/src/test/java/example/springdata/jpa/java8/Java8IntegrationTests.java @@ -18,6 +18,8 @@ package example.springdata.jpa.java8; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; +import lombok.extern.slf4j.Slf4j; + import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; @@ -41,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = AuditingConfiguration.class) @Transactional +@Slf4j public class Java8IntegrationTests { @Autowired CustomerRepository repository; @@ -104,10 +107,8 @@ public class Java8IntegrationTests { } /** - * Here we demonstrate the usage of CompletableFuture as a result wrapper for asynchronous - * Repository query methods. - * - * Note that we need to disable the surrounding TX to be able to asynchronously read the wirtten + * Here we demonstrate the usage of {@link CompletableFuture} as a result wrapper for asynchronous repository query + * methods. Note, that we need to disable the surrounding transaction to be able to asynchronously read the written * data from from another thread within the same test method. */ @Test @@ -118,19 +119,19 @@ public class Java8IntegrationTests { repository.save(new Customer("Customer2", "Bar")); CompletableFuture future = repository.readAllBy().thenAccept(customers -> { - + assertThat(customers, hasSize(2)); - - customers.forEach(System.out::println); - System.out.println("Completed!"); + customers.forEach(customer -> log.info(customer.toString())); + log.info("Completed!"); }); while (!future.isDone()) { - System.out.println("waiting..."); + log.info("Waiting for the CompletableFuture to finish..."); TimeUnit.MILLISECONDS.sleep(500); } future.get(); - System.out.println("Done"); + + log.info("Done!"); } } diff --git a/jpa/java8/src/test/resources/application.properties b/jpa/java8/src/test/resources/application.properties deleted file mode 100644 index f1e8a3d1..00000000 --- a/jpa/java8/src/test/resources/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -#logging.level.org.springframework=INFO -#logging.level.org.springframework.orm=TRACE -#logging.level.org.springframework.transaction=TRACE -#logging.level.org.hsqldb=TRACE \ No newline at end of file diff --git a/jpa/pom.xml b/jpa/pom.xml index c3f827ef..f5a0818a 100644 --- a/jpa/pom.xml +++ b/jpa/pom.xml @@ -39,11 +39,6 @@ joda-time - - - - - org.hsqldb hsqldb