parent
e63873332c
commit
5066478069
|
@ -3,6 +3,7 @@
|
|||
<mapper namespace="com.dispose.mapper.DisposeCapacityMapper">
|
||||
<resultMap id="dispose_capacity" type="com.dispose.pojo.entity.DisposeCapacity">
|
||||
<id column="id" property="id"/>
|
||||
<id column = "deviceId" property="deviceId"/>
|
||||
<result column="capacityType" property="capacityType" javaType="com.dispose.common.DisposeCapacityType"/>
|
||||
<result column="objectType" property="objectType" javaType="com.dispose.common.DisposeObjectType"/>
|
||||
<result column="ipType" property="ipType" javaType="com.dispose.common.IpAddrType"/>
|
||||
|
|
|
@ -116,15 +116,18 @@ public class DisposeCapacityMapperTest {
|
|||
items = disposeCapacityMapper.delDisposeCapacity(capList.get(0).getDeviceId(),
|
||||
capList.get(0).getCapacityType().getCode());
|
||||
|
||||
Assert.assertEquals(items, 1);
|
||||
Assert.assertEquals(items, 2);
|
||||
|
||||
capList = disposeCapacityMapper.selectAll();
|
||||
List<DisposeCapacity> caps = disposeCapacityMapper.selectAll();
|
||||
|
||||
Assert.assertEquals(capList.size(), 1);
|
||||
Assert.assertEquals(caps.size(), capList.size() - items);
|
||||
|
||||
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(capList));
|
||||
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(caps));
|
||||
}
|
||||
|
||||
/**
|
||||
* A 3 del dispose capacity.
|
||||
*/
|
||||
@Test
|
||||
public void a3_delDeviceDisposeCapacity() {
|
||||
List<DisposeCapacity> newCapList = new ArrayList<>();
|
||||
|
@ -147,12 +150,19 @@ public class DisposeCapacityMapperTest {
|
|||
|
||||
Assert.assertEquals(disposeCapacityMapper.addNewDisposeCapacity(newCapList), newCapList.size());
|
||||
|
||||
List<DisposeCapacity> capList = disposeCapacityMapper.getDeviceDisposeCapacity(1L);
|
||||
|
||||
Assert.assertEquals(disposeCapacityMapper.delDeviceDisposeCapacity(newCapList.get(0).getDeviceId()),
|
||||
newCapList.size());
|
||||
capList.size());
|
||||
|
||||
Assert.assertEquals(0, disposeCapacityMapper.selectAll().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* B 1 get dispose capacity.
|
||||
*
|
||||
* @throws JsonProcessingException the json processing exception
|
||||
*/
|
||||
@Test
|
||||
public void b1_getDeviceDisposeCapacity() throws JsonProcessingException {
|
||||
List<DisposeCapacity> newCapList = new ArrayList<>();
|
||||
|
@ -173,11 +183,13 @@ public class DisposeCapacityMapperTest {
|
|||
.protectIp("")
|
||||
.build());
|
||||
|
||||
List<DisposeCapacity> caps = disposeCapacityMapper.getDeviceDisposeCapacity(1L);
|
||||
|
||||
Assert.assertEquals(disposeCapacityMapper.addNewDisposeCapacity(newCapList), newCapList.size());
|
||||
|
||||
List<DisposeCapacity> capList = disposeCapacityMapper.getDeviceDisposeCapacity(newCapList.get(0).getDeviceId());
|
||||
|
||||
Assert.assertEquals(capList.size(), newCapList.size());
|
||||
Assert.assertEquals(capList.size(), caps.size() + newCapList.size());
|
||||
|
||||
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(capList));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue