This commit is contained in:
insanity 2018-06-15 15:10:55 +09:00
parent 816bb769f8
commit a9ed9a705a
2 changed files with 40 additions and 0 deletions

View File

@ -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, Integer> {
MetaTargetType findByKey(String key);
List<MetaTargetType> findAllByMetaInfraType(MetaInfraType metaInfraType);
}

View File

@ -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<MetaTargetType> metaTargetTypes = this.metaTargetTypeDAO
.findAllByMetaInfraType(MetaInfraType.Enum.SERVICE.to());
assertNotNull(metaTargetTypes);
}
}