diff --git a/src/main/java/com/loafle/overflow/module/history/dao/HistoryDAO.java b/src/main/java/com/loafle/overflow/module/history/dao/HistoryDAO.java index 788bf2a..832cbfc 100644 --- a/src/main/java/com/loafle/overflow/module/history/dao/HistoryDAO.java +++ b/src/main/java/com/loafle/overflow/module/history/dao/HistoryDAO.java @@ -1,10 +1,13 @@ package com.loafle.overflow.module.history.dao; +import com.loafle.overflow.module.history.model.History; +import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Created by insanity on 17. 8. 23. */ @Repository -public class HistoryDAO { +public interface HistoryDAO extends JpaRepository { + } diff --git a/src/main/java/com/loafle/overflow/module/meta/dao/MetaHistoryTypeDAO.java b/src/main/java/com/loafle/overflow/module/meta/dao/MetaHistoryTypeDAO.java index 146708e..9ba663e 100644 --- a/src/main/java/com/loafle/overflow/module/meta/dao/MetaHistoryTypeDAO.java +++ b/src/main/java/com/loafle/overflow/module/meta/dao/MetaHistoryTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.module.meta.dao; -import com.loafle.overflow.module.meta.model.MetaInfraType; +import com.loafle.overflow.module.meta.model.MetaHistoryType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository; * Created by insanity on 17. 6. 23. */ @Repository -public interface MetaHistoryTypeDAO extends JpaRepository { +public interface MetaHistoryTypeDAO extends JpaRepository { } diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaHistoryType.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaHistoryType.java index c19ca4e..2c71d80 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaHistoryType.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaHistoryType.java @@ -7,7 +7,7 @@ import java.util.Date; * Created by root on 17. 6. 22. */ @Entity -@Table(name = "META_INFRA_TYPE", schema = "public") +@Table(name = "META_HISTORY_TYPE", schema = "public") public class MetaHistoryType { private int id; private String name; diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeService.java index 0ba0e43..6544f56 100644 --- a/src/main/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeService.java +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeService.java @@ -1,7 +1,7 @@ package com.loafle.overflow.module.meta.service; import com.loafle.overflow.module.meta.dao.MetaHistoryTypeDAO; -import com.loafle.overflow.module.meta.model.MetaInfraType; +import com.loafle.overflow.module.meta.model.MetaHistoryType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,7 +16,7 @@ public class MetaHistoryTypeService { @Autowired private MetaHistoryTypeDAO hisotyTypeDAO; - public List readAll() { + public List readAll() { return this.hisotyTypeDAO.findAll(); } } diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeServiceTest.java new file mode 100644 index 0000000..b30002d --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaHistoryTypeServiceTest.java @@ -0,0 +1,30 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaHistoryType; +import com.loafle.overflow.spring.AppConfigTest; +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 java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfigTest.class}) +public class MetaHistoryTypeServiceTest { + + @Autowired + private MetaHistoryTypeService historyTypeService; + + @Test + public void readAll() throws Exception { + + List historyTypes = this.historyTypeService.readAll(); + + } + +} \ No newline at end of file