| | |
| | | } |
| | | |
| | | @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 |