云
20 小时以前 d17024670efca145ff97bc26913bfd9b0fef2cd0
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/qc/imports/MesQcOptionalClientTest.java
@@ -35,13 +35,14 @@
    }
    @Test
    void customerPermissionsStillApplyWhenACustomerIsSupplied() {
    void customerPermissionsDoNotRestrictMesImports() {
        CrmCustomerApi crm = mock(CrmCustomerApi.class);
        when(crm.getPermittedCustomerIds()).thenReturn(List.of(10L));
        MesQcImportHelper helper = new MesQcImportHelper();
        ReflectionTestUtils.setField(helper, "crmCustomerApi", crm);
        helper.validateClientPermission(10L, "可见客户");
        assertThrows(IllegalArgumentException.class, () -> helper.validateClientPermission(20L, "不可见客户"));
        assertDoesNotThrow(() -> helper.validateClientPermission(20L, "其他客户"));
        verifyNoInteractions(crm);
    }
    @Test