test
This commit is contained in:
parent
40118b4d96
commit
5f52fc9bf2
2
pom.xml
2
pom.xml
|
@ -50,7 +50,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.loafle.overflow</groupId>
|
<groupId>com.loafle.overflow</groupId>
|
||||||
<artifactId>commons-java</artifactId>
|
<artifactId>commons-java</artifactId>
|
||||||
<version>1.0.85-SNAPSHOT</version>
|
<version>1.0.86-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.loafle.overflow.central.module.meta.dao;
|
||||||
|
|
||||||
import java.util.List;
|
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;
|
||||||
|
@ -14,5 +13,5 @@ import org.springframework.stereotype.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);
|
List<MetaTargetType> findAllByMetaInfraTypeKey(String key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class CentralMetaTargetTypeService implements MetaTargetTypeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MetaTargetType> readAllByMetaInfraType(MetaInfraType metaInfraType) throws OverflowException {
|
public List<MetaTargetType> readAllByMetaInfraTypeKey(String key) throws OverflowException {
|
||||||
return this.metaTargetTypeDAO.findAllByMetaInfraType(metaInfraType);
|
return this.metaTargetTypeDAO.findAllByMetaInfraTypeKey(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
package com.loafle.overflow.central.module.meta.dao;
|
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.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.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
|
||||||
|
@ -21,15 +13,4 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
@ContextConfiguration(classes = { AppConfigTest.class })
|
@ContextConfiguration(classes = { AppConfigTest.class })
|
||||||
public class MetaTargetTypeDAOTest {
|
public class MetaTargetTypeDAOTest {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MetaTargetTypeDAO metaTargetTypeDAO;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void findAllByMetaInfraType() throws Exception {
|
|
||||||
|
|
||||||
List<MetaTargetType> metaTargetTypes = this.metaTargetTypeDAO
|
|
||||||
.findAllByMetaInfraType(MetaInfraType.Enum.SERVICE.to());
|
|
||||||
assertNotNull(metaTargetTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user