diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAO.java index 9908282..4f9a318 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAO.java @@ -1,5 +1,8 @@ package com.loafle.overflow.central.module.meta.dao; +import java.util.List; + +import com.loafle.overflow.model.meta.MetaInfraType; import com.loafle.overflow.model.meta.MetaTargetType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -10,4 +13,6 @@ import org.springframework.stereotype.Repository; @Repository public interface MetaTargetTypeDAO extends JpaRepository { MetaTargetType findByKey(String key); + + List findAllByMetaInfraType(MetaInfraType metaInfraType); } diff --git a/src/test/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAOTest.java b/src/test/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAOTest.java new file mode 100644 index 0000000..15dd563 --- /dev/null +++ b/src/test/java/com/loafle/overflow/central/module/meta/dao/MetaTargetTypeDAOTest.java @@ -0,0 +1,35 @@ +package com.loafle.overflow.central.module.meta.dao; + +import static org.junit.Assert.assertNotNull; + +import java.util.List; + +import com.loafle.overflow.central.spring.AppConfigTest; +import com.loafle.overflow.model.meta.MetaInfraType; +import com.loafle.overflow.model.meta.MetaTargetType; + +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; + +/** + * Created by snoop on 17. 9. 14. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { AppConfigTest.class }) +public class MetaTargetTypeDAOTest { + + @Autowired + private MetaTargetTypeDAO metaTargetTypeDAO; + + @Test + public void findTest() throws Exception { + + List metaTargetTypes = this.metaTargetTypeDAO + .findAllByMetaInfraType(MetaInfraType.Enum.SERVICE.to()); + assertNotNull(metaTargetTypes); + } + +}