test
This commit is contained in:
parent
816bb769f8
commit
a9ed9a705a
@ -1,5 +1,8 @@
|
|||||||
package com.loafle.overflow.central.module.meta.dao;
|
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 com.loafle.overflow.model.meta.MetaTargetType;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@ -10,4 +13,6 @@ import org.springframework.stereotype.Repository;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface MetaTargetTypeDAO extends JpaRepository<MetaTargetType, Integer> {
|
public interface MetaTargetTypeDAO extends JpaRepository<MetaTargetType, Integer> {
|
||||||
MetaTargetType findByKey(String key);
|
MetaTargetType findByKey(String key);
|
||||||
|
|
||||||
|
List<MetaTargetType> findAllByMetaInfraType(MetaInfraType metaInfraType);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user