* Revert "BAEL-1924 (#4573)"

This reverts commit b1b34e2fca.

* BAEL-1924 move code to new spring-boot-persistence module

* BAEL-1924 add new spring-boot-persistence module
This commit is contained in:
abialas
2018-06-30 19:12:01 +02:00
committed by maibin
parent 111c39d4c9
commit 97bddd2a20
22 changed files with 613 additions and 17 deletions

View File

@@ -1,30 +0,0 @@
package org.baeldung.boot.repository;
import org.baeldung.boot.domain.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Collection;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Created by adam.
*/
@RunWith(SpringRunner.class)
@DataJpaTest
public class UserRepositoryDataJpaIntegrationTest {
@Autowired private UserRepository userRepository;
@Test
public void givenTwoImportFilesWhenFindAllShouldReturnSixUsers() {
Collection<User> users = userRepository.findAll();
assertThat(users.size()).isEqualTo(6);
}
}

View File

@@ -1,7 +1,7 @@
package org.baeldung.boot.repository;
package org.baeldung.repository;
import org.baeldung.boot.config.H2JpaConfig;
import org.baeldung.boot.domain.User;
import org.baeldung.model.User;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -27,7 +27,8 @@ public class UserRepositoryIntegrationTest {
private final String USER_NAME_ADAM = "Adam";
private final Integer ACTIVE_STATUS = 1;
@Autowired private UserRepository userRepository;
@Autowired
private UserRepository userRepository;
@Test
public void givenEmptyDBWhenFindOneByNameThenReturnEmptyOptional() {