云
3 天以前 95ae0c83d2aa58d86b4039e3f7f16ee93afb8f00
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