yeg
2026-08-29 795c16bd3aa31f4faa4fe8a8e2155718cac0e5d1
ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TBatteryGroupServiceImplTest.java
@@ -20,6 +20,7 @@
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 单元测试。 */
@@ -96,7 +97,7 @@
        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));
@@ -128,7 +129,7 @@
        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));