From 3a4426e7ca5161b0f9526f752749844c13d33cf3 Mon Sep 17 00:00:00 2001 From: eugenp Date: Sun, 27 Dec 2015 23:55:25 +0200 Subject: [PATCH] testing work --- spring-hibernate4/pom.xml | 5 +++++ spring-jpa/pom.xml | 5 +++++ .../baeldung/persistence/service/FooServiceSortingTests.java | 4 ---- .../{JPAMultipleDBTest.java => JpaMultipleDBTest.java} | 5 ++++- .../baeldung/persistence/service/PersistenceTestSuite.java | 1 + 5 files changed, 15 insertions(+), 5 deletions(-) rename spring-jpa/src/test/java/org/baeldung/persistence/service/{JPAMultipleDBTest.java => JpaMultipleDBTest.java} (98%) diff --git a/spring-hibernate4/pom.xml b/spring-hibernate4/pom.xml index d24024f151..f3c2806353 100644 --- a/spring-hibernate4/pom.xml +++ b/spring-hibernate4/pom.xml @@ -77,6 +77,11 @@ hibernate-validator ${hibernate-validator.version} + + javax.el + javax.el-api + 2.2.5 + diff --git a/spring-jpa/pom.xml b/spring-jpa/pom.xml index 63d97c337b..20be07ca5b 100644 --- a/spring-jpa/pom.xml +++ b/spring-jpa/pom.xml @@ -58,6 +58,11 @@ hibernate-validator ${hibernate-validator.version} + + javax.el + javax.el-api + 2.2.5 + diff --git a/spring-jpa/src/test/java/org/baeldung/persistence/service/FooServiceSortingTests.java b/spring-jpa/src/test/java/org/baeldung/persistence/service/FooServiceSortingTests.java index c12dfda50c..319d36151e 100644 --- a/spring-jpa/src/test/java/org/baeldung/persistence/service/FooServiceSortingTests.java +++ b/spring-jpa/src/test/java/org/baeldung/persistence/service/FooServiceSortingTests.java @@ -15,7 +15,6 @@ import org.baeldung.persistence.model.Bar; import org.baeldung.persistence.model.Foo; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; @@ -28,9 +27,6 @@ public class FooServiceSortingTests { @PersistenceContext private EntityManager entityManager; - @Autowired - private FooService service; - // tests @Test diff --git a/spring-jpa/src/test/java/org/baeldung/persistence/service/JPAMultipleDBTest.java b/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBTest.java similarity index 98% rename from spring-jpa/src/test/java/org/baeldung/persistence/service/JPAMultipleDBTest.java rename to spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBTest.java index 4c6b02ec3d..427e182d9e 100644 --- a/spring-jpa/src/test/java/org/baeldung/persistence/service/JPAMultipleDBTest.java +++ b/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBTest.java @@ -21,13 +21,16 @@ import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { UserConfig.class, ProductConfig.class }) @TransactionConfiguration -public class JPAMultipleDBTest { +public class JpaMultipleDBTest { + @Autowired private UserRepository userRepository; @Autowired private ProductRepository productRepository; + // tests + @Test @Transactional("userTransactionManager") public void whenCreatingUser_thenCreated() { diff --git a/spring-jpa/src/test/java/org/baeldung/persistence/service/PersistenceTestSuite.java b/spring-jpa/src/test/java/org/baeldung/persistence/service/PersistenceTestSuite.java index f6c41258d4..919171de9f 100644 --- a/spring-jpa/src/test/java/org/baeldung/persistence/service/PersistenceTestSuite.java +++ b/spring-jpa/src/test/java/org/baeldung/persistence/service/PersistenceTestSuite.java @@ -8,6 +8,7 @@ import org.junit.runners.Suite; FooPaginationPersistenceIntegrationTest.class ,FooServicePersistenceIntegrationTest.class ,FooServiceSortingTests.class + ,JpaMultipleDBTest.class // manual only // ,FooServiceSortingWitNullsManualTest.class }) // @formatter:on