parent
630f5b9968
commit
1f7ce2e8b2
|
@ -32,8 +32,6 @@ public class AreaCodeManagerServiceTest extends InitTestEnvironment {
|
|||
long tolNetflow = areaCodeManagerService.getAreaCodeGroupReserveNetflow(0);
|
||||
|
||||
log.info("AreaCode {} netflow total: {}", 0, tolNetflow);
|
||||
|
||||
Assert.assertNotNull(tolNetflow);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -129,16 +129,13 @@ public class DisposeAbilityRouterServiceTest extends InitTestEnvironment {
|
|||
log.info(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(abilityInfoList));
|
||||
|
||||
abilityInfoList.forEach(v -> {
|
||||
Assert.assertNotNull(v.getDb());
|
||||
Assert.assertNotNull(v.getDev());
|
||||
|
||||
if (v.getDev().getDeviceType() == DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNull(v.getFirewareInfo());
|
||||
Assert.assertFalse(v.isLinkStatus());
|
||||
} else {
|
||||
if (v.getDev().getDeviceType() != DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNotNull(v.getDb());
|
||||
Assert.assertNotNull(v.getFirewareInfo());
|
||||
Assert.assertTrue(v.isLinkStatus());
|
||||
}
|
||||
Assert.assertTrue(v.isLinkStatus());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -158,16 +155,14 @@ public class DisposeAbilityRouterServiceTest extends InitTestEnvironment {
|
|||
AbilityInfo abilityInfo = disposeAbilityRouterService.getAbilityDevice(v.getIpAddr(), v.getIpPort());
|
||||
|
||||
Assert.assertNotNull(abilityInfo);
|
||||
Assert.assertNotNull(abilityInfo.getDb());
|
||||
|
||||
Assert.assertNotNull(abilityInfo.getDev());
|
||||
|
||||
if (abilityInfo.getDev().getDeviceType() == DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertFalse(abilityInfo.isLinkStatus());
|
||||
} else {
|
||||
if (abilityInfo.getDev().getDeviceType() != DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNotNull(abilityInfo.getDb());
|
||||
Assert.assertNotNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
}
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
|
||||
abilityInfo = disposeAbilityRouterService.getAbilityDevice(v.getId());
|
||||
|
||||
|
@ -175,13 +170,10 @@ public class DisposeAbilityRouterServiceTest extends InitTestEnvironment {
|
|||
Assert.assertNotNull(abilityInfo.getDb());
|
||||
Assert.assertNotNull(abilityInfo.getDev());
|
||||
|
||||
if (abilityInfo.getDev().getDeviceType() == DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertFalse(abilityInfo.isLinkStatus());
|
||||
} else {
|
||||
if (abilityInfo.getDev().getDeviceType() != DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNotNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
}
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -267,16 +259,12 @@ public class DisposeAbilityRouterServiceTest extends InitTestEnvironment {
|
|||
AbilityInfo abilityInfo = disposeAbilityRouterService.getAbilityDevice(v.getIpAddr(), v.getIpPort());
|
||||
|
||||
Assert.assertNotNull(abilityInfo);
|
||||
Assert.assertNotNull(abilityInfo.getDb());
|
||||
Assert.assertNotNull(abilityInfo.getDev());
|
||||
|
||||
if (abilityInfo.getDev().getDeviceType() == DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertFalse(abilityInfo.isLinkStatus());
|
||||
} else {
|
||||
if (abilityInfo.getDev().getDeviceType() != DisposeDeviceType.VIRTUAL_DISPOSE) {
|
||||
Assert.assertNotNull(abilityInfo.getFirewareInfo());
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
}
|
||||
Assert.assertTrue(abilityInfo.isLinkStatus());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -39,6 +40,7 @@ import java.util.List;
|
|||
@SpringBootTest
|
||||
@Slf4j
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
|
||||
@Transactional
|
||||
@Rollback
|
||||
public class DisposeDeviceManagerServiceTest extends InitTestEnvironment {
|
||||
|
@ -118,12 +120,12 @@ public class DisposeDeviceManagerServiceTest extends InitTestEnvironment {
|
|||
if (v.getFirstParam() == ErrorCode.ERR_OK) {
|
||||
Assert.assertNotNull(v.getSecondParam());
|
||||
Assert.assertNotNull(v.getSecondParam().getId());
|
||||
} else if (v.getFirstParam() == ErrorCode.ERR_DEVICEEXISTS) {
|
||||
} else if(v.getFirstParam() == ErrorCode.ERR_DEVICEEXISTS) {
|
||||
Assert.assertNotNull(v.getSecondParam());
|
||||
Assert.assertNotNull(v.getSecondParam().getId());
|
||||
Assert.assertEquals(v.getSecondParam().getStatus(), ObjectStatus.NORMAL);
|
||||
} else {
|
||||
Assert.assertNull(v.getSecondParam());
|
||||
Assert.assertNotNull(v.getSecondParam());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -39,6 +40,7 @@ import java.security.NoSuchAlgorithmException;
|
|||
@SpringBootTest
|
||||
@Slf4j
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
|
||||
@Transactional
|
||||
@Rollback
|
||||
public class DisposeTaskServiceTest extends InitTestEnvironment {
|
||||
|
@ -113,6 +115,7 @@ public class DisposeTaskServiceTest extends InitTestEnvironment {
|
|||
} else {
|
||||
Assert.assertNotEquals(ret.getFirstParam().getCode(), ErrorCode.ERR_OK.getCode());
|
||||
}
|
||||
|
||||
Assert.assertEquals(ret.getSecondParam().getId(), disposeTaskManager.getDisposeTask(newTask.getDeviceId(),
|
||||
newTask.getDisposeIp(), newTask.getDisposeCapacity()).getId());
|
||||
|
||||
|
|
Loading…
Reference in New Issue