| | |
| | | import com.ruoyi.system.domain.TBatteryGroup; |
| | | import com.ruoyi.system.domain.TBatteryGroupBattery; |
| | | import com.ruoyi.system.domain.TBatteryGroupRelationField; |
| | | import com.ruoyi.system.domain.TBatteryGroupTemplate; |
| | | import com.ruoyi.system.mapper.TBatteryGroupMapper; |
| | | |
| | | /** 电池组 Service 单元测试。 */ |
| | |
| | | when(batteryGroupMapper.selectBatteryGroupById(12L)).thenReturn(current); |
| | | when(batteryGroupMapper.countTestingByGroupId(12L)).thenReturn(0); |
| | | when(batteryGroupMapper.selectBatteryByNo("BAT-01", 12L)).thenReturn(null); |
| | | when(batteryGroupMapper.selectTemplate(5L)).thenReturn(new TBatteryGroup()); |
| | | when(batteryGroupMapper.selectTemplate(5L)).thenReturn(new TBatteryGroupTemplate()); |
| | | when(batteryGroupMapper.selectTemplateFieldIds(5L)).thenReturn(Collections.singletonList(7L)); |
| | | when(batteryGroupMapper.selectValidTemplateFields(5L, Collections.singletonList(7L))) |
| | | .thenReturn(Collections.singletonList(relation)); |
| | |
| | | validField.setFieldType("number"); |
| | | when(batteryGroupMapper.selectBatteryGroupByName("样品组")).thenReturn(null); |
| | | when(batteryGroupMapper.selectBatteryByNo("BAT-01", null)).thenReturn(null); |
| | | when(batteryGroupMapper.selectTemplate(5L)).thenReturn(new TBatteryGroup()); |
| | | when(batteryGroupMapper.selectTemplate(5L)).thenReturn(new TBatteryGroupTemplate()); |
| | | when(batteryGroupMapper.selectTemplateFieldIds(5L)).thenReturn(Collections.singletonList(7L)); |
| | | when(batteryGroupMapper.selectValidTemplateFields(5L, Collections.singletonList(7L))) |
| | | .thenReturn(Collections.singletonList(validField)); |