diff --git a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/EmployeeRepository.java b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/EmployeeRepository.java index c6b75e5994..6185185791 100644 --- a/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/EmployeeRepository.java +++ b/persistence-modules/spring-data-jpa/src/main/java/com/baeldung/dao/repositories/EmployeeRepository.java @@ -2,8 +2,8 @@ package com.baeldung.dao.repositories; import org.springframework.data.jpa.repository.JpaRepository; -import com.baeldung.domain.Person; +import com.baeldung.domain.Employee; -public interface PersonRepository extends JpaRepository { +public interface EmployeeRepository extends JpaRepository { } diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/EmployeeRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/EmployeeRepositoryIntegrationTest.java index d2e3ac67a0..13ceb702d2 100644 --- a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/EmployeeRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/dao/repositories/EmployeeRepositoryIntegrationTest.java @@ -8,32 +8,32 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.domain.Person; +import com.baeldung.domain.Employee; @RunWith(SpringRunner.class) @DataJpaTest -public class PersonRepositoryIntegrationTest { +public class EmployeeRepositoryIntegrationTest { - private static final Person PERSON1 = new Person(1L, "John", "Doe"); - private static final Person PERSON2 = new Person(2L, "Alice", "Bob"); + private static final Employee EMPLOYEE1 = new Employee(1L, "John"); + private static final Employee EMPLOYEE2 = new Employee(2L, "Alice"); @Autowired - private PersonRepository personRepository; + private EmployeeRepository employeeRepository; @Test - public void givenPersonEntity_whenInsertWithSave_ThenPersonIsPersisted() { - personRepository.save(PERSON1); - assertPersonPersisted(PERSON1); + public void givenEmployeeEntity_whenInsertWithSave_ThenEmployeeIsPersisted() { + employeeRepository.save(EMPLOYEE1); + assertEmployeePersisted(EMPLOYEE1); } @Test - public void givenPersonEntity_whenInsertWithSaveAndFlush_ThenPersonIsPersisted() { - personRepository.saveAndFlush(PERSON2); - assertPersonPersisted(PERSON2); + public void givenEmployeeEntity_whenInsertWithSaveAndFlush_ThenEmployeeIsPersisted() { + employeeRepository.saveAndFlush(EMPLOYEE2); + assertEmployeePersisted(EMPLOYEE2); } - private void assertPersonPersisted(Person input) { - Person person = personRepository.getOne(input.getId()); - assertThat(person).isNotNull(); + private void assertEmployeePersisted(Employee input) { + Employee employee = employeeRepository.getOne(input.getId()); + assertThat(employee).isNotNull(); } }