testing work

This commit is contained in:
eugenp 2015-12-27 23:55:25 +02:00 committed by David Morley
parent 1edcb35d2c
commit 3a4426e7ca
5 changed files with 15 additions and 5 deletions

View File

@ -77,6 +77,11 @@
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version> <version>${hibernate-validator.version}</version>
</dependency> </dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>2.2.5</version>
</dependency>
<!-- utils --> <!-- utils -->

View File

@ -58,6 +58,11 @@
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version> <version>${hibernate-validator.version}</version>
</dependency> </dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>2.2.5</version>
</dependency>
<!-- utils --> <!-- utils -->

View File

@ -15,7 +15,6 @@ import org.baeldung.persistence.model.Bar;
import org.baeldung.persistence.model.Foo; import org.baeldung.persistence.model.Foo;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader; import org.springframework.test.context.support.AnnotationConfigContextLoader;
@ -28,9 +27,6 @@ public class FooServiceSortingTests {
@PersistenceContext @PersistenceContext
private EntityManager entityManager; private EntityManager entityManager;
@Autowired
private FooService service;
// tests // tests
@Test @Test

View File

@ -21,13 +21,16 @@ import org.springframework.transaction.annotation.Transactional;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { UserConfig.class, ProductConfig.class }) @ContextConfiguration(classes = { UserConfig.class, ProductConfig.class })
@TransactionConfiguration @TransactionConfiguration
public class JPAMultipleDBTest { public class JpaMultipleDBTest {
@Autowired @Autowired
private UserRepository userRepository; private UserRepository userRepository;
@Autowired @Autowired
private ProductRepository productRepository; private ProductRepository productRepository;
// tests
@Test @Test
@Transactional("userTransactionManager") @Transactional("userTransactionManager")
public void whenCreatingUser_thenCreated() { public void whenCreatingUser_thenCreated() {

View File

@ -8,6 +8,7 @@ import org.junit.runners.Suite;
FooPaginationPersistenceIntegrationTest.class FooPaginationPersistenceIntegrationTest.class
,FooServicePersistenceIntegrationTest.class ,FooServicePersistenceIntegrationTest.class
,FooServiceSortingTests.class ,FooServiceSortingTests.class
,JpaMultipleDBTest.class
// manual only // manual only
// ,FooServiceSortingWitNullsManualTest.class // ,FooServiceSortingWitNullsManualTest.class
}) // @formatter:on }) // @formatter:on