REM:
1. 增加线上环境单元测试报错调试代码
This commit is contained in:
huangxin 2020-04-30 12:03:08 +08:00
parent 037221684b
commit 2fbf0f3e11
2 changed files with 3 additions and 6 deletions

View File

@ -50,6 +50,8 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
*/ */
@Override @Override
public void loadDisposeNodeFromDB() { public void loadDisposeNodeFromDB() {
disposeDevMap.clear();
List<DisposeDevice> devList = disposeDeviceMapper.selectAll(); List<DisposeDevice> devList = disposeDeviceMapper.selectAll();
if (devList == null) { if (devList == null) {

View File

@ -27,8 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
@SpringBootTest @SpringBootTest
@Slf4j @Slf4j
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Transactional
@Rollback
public class DisposeNodeManagerTest extends InitTestEnvironment { public class DisposeNodeManagerTest extends InitTestEnvironment {
/** /**
* The Used ip addr. * The Used ip addr.
@ -61,6 +59,7 @@ public class DisposeNodeManagerTest extends InitTestEnvironment {
*/ */
@Override @Override
public void userLogin() { public void userLogin() {
disposeNodeManager.loadDisposeNodeFromDB();
} }
/** /**
@ -114,8 +113,6 @@ public class DisposeNodeManagerTest extends InitTestEnvironment {
Assert.assertEquals(disposeNodeManager.getAllDisposeDevice().size(), 0); Assert.assertEquals(disposeNodeManager.getAllDisposeDevice().size(), 0);
disposeNodeManager.cleanupDisposeNodeCache(); disposeNodeManager.cleanupDisposeNodeCache();
} }
disposeNodeManager.loadDisposeNodeFromDB();
} }
@Test @Test
@ -124,7 +121,5 @@ public class DisposeNodeManagerTest extends InitTestEnvironment {
ErrorCode ret = disposeNodeManager.delDisposeDeviceByIp(v.getIpAddr()); ErrorCode ret = disposeNodeManager.delDisposeDeviceByIp(v.getIpAddr());
Assert.assertEquals(ret, ErrorCode.ERR_OK); Assert.assertEquals(ret, ErrorCode.ERR_OK);
}); });
disposeNodeManager.loadDisposeNodeFromDB();
} }
} }