REM:
1. 统一单元测试环境
This commit is contained in:
HuangXin 2020-09-16 14:34:06 +08:00
parent 76fff9ad04
commit 163432d68c
8 changed files with 16 additions and 8 deletions

View File

@ -6,6 +6,7 @@ import com.dispose.manager.DeviceTaskManager;
import com.dispose.mapper.DeviceTaskMapper; import com.dispose.mapper.DeviceTaskMapper;
import com.dispose.mapper.DisposeTaskMapper; import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.pojo.entity.DeviceTask; import com.dispose.pojo.entity.DeviceTask;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -35,7 +36,7 @@ import java.util.List;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DeviceTaskManagerTest { public class DeviceTaskManagerTest extends InitTestEnvironment {
/** /**
* The Object mapper. * The Object mapper.
*/ */

View File

@ -6,6 +6,7 @@ import com.dispose.manager.DisposeDeviceManager;
import com.dispose.mapper.DisposeDeviceMapper; import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.pojo.entity.DisposeDevice; import com.dispose.pojo.entity.DisposeDevice;
import com.dispose.pojo.po.MulReturnType; import com.dispose.pojo.po.MulReturnType;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -38,7 +39,7 @@ import java.util.List;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DisposeDeviceManagerTest { public class DisposeDeviceManagerTest extends InitTestEnvironment {
/** /**
* The Object mapper. * The Object mapper.
*/ */

View File

@ -10,6 +10,7 @@ import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper; import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.mapper.UserAccountMapper; import com.dispose.mapper.UserAccountMapper;
import com.dispose.pojo.entity.DisposeTask; import com.dispose.pojo.entity.DisposeTask;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -39,7 +40,7 @@ import java.util.List;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DisposeTaskManagerTest { public class DisposeTaskManagerTest extends InitTestEnvironment {
/** /**
* The Object mapper. * The Object mapper.
*/ */

View File

@ -5,6 +5,7 @@ import com.dispose.mapper.DeviceTaskMapper;
import com.dispose.mapper.DisposeDeviceMapper; import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper; import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.pojo.entity.DeviceTask; import com.dispose.pojo.entity.DeviceTask;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -35,7 +36,7 @@ import java.util.List;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DeviceTaskMapperTest { public class DeviceTaskMapperTest extends InitTestEnvironment {
/** /**
* The Dispose task mapper. * The Dispose task mapper.
*/ */

View File

@ -6,6 +6,7 @@ import com.dispose.common.IpAddrType;
import com.dispose.mapper.DisposeCapacityMapper; import com.dispose.mapper.DisposeCapacityMapper;
import com.dispose.mapper.DisposeDeviceMapper; import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.pojo.entity.DisposeCapacity; import com.dispose.pojo.entity.DisposeCapacity;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -36,7 +37,7 @@ import java.util.List;
@Transactional @Transactional
@Rollback @Rollback
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class DisposeCapacityMapperTest { public class DisposeCapacityMapperTest extends InitTestEnvironment {
/** /**
* The Dispose capacity mapper. * The Dispose capacity mapper.

View File

@ -5,6 +5,7 @@ import com.dispose.common.HttpType;
import com.dispose.common.ObjectStatus; import com.dispose.common.ObjectStatus;
import com.dispose.mapper.DisposeDeviceMapper; import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.pojo.entity.DisposeDevice; import com.dispose.pojo.entity.DisposeDevice;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -35,7 +36,7 @@ import java.util.Optional;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DisposeDeviceMapperTest { public class DisposeDeviceMapperTest extends InitTestEnvironment {
/** /**
* The Object mapper. * The Object mapper.
*/ */

View File

@ -8,6 +8,7 @@ import com.dispose.mapper.DisposeDeviceMapper;
import com.dispose.mapper.DisposeTaskMapper; import com.dispose.mapper.DisposeTaskMapper;
import com.dispose.mapper.UserAccountMapper; import com.dispose.mapper.UserAccountMapper;
import com.dispose.pojo.entity.DisposeTask; import com.dispose.pojo.entity.DisposeTask;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -37,7 +38,7 @@ import java.util.List;
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@Transactional @Transactional
@Rollback @Rollback
public class DisposeTaskMapperTest { public class DisposeTaskMapperTest extends InitTestEnvironment {
/** /**
* The Dispose task mapper. * The Dispose task mapper.
*/ */

View File

@ -3,6 +3,7 @@ package com.dispose.test.dev.mapper;
import com.dispose.common.ObjectStatus; import com.dispose.common.ObjectStatus;
import com.dispose.mapper.UserAccountMapper; import com.dispose.mapper.UserAccountMapper;
import com.dispose.pojo.entity.UserAccount; import com.dispose.pojo.entity.UserAccount;
import com.dispose.test.dev.Global.InitTestEnvironment;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -33,7 +34,7 @@ import java.util.List;
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Transactional @Transactional
@Rollback @Rollback
public class UserAccountMapperTest { public class UserAccountMapperTest extends InitTestEnvironment {
/** /**
* The Obj mapper. * The Obj mapper.
*/ */