mirror of
https://gitee.com/zhijiantianya/yudao-cloud.git
synced 2026-10-06 07:22:58 +08:00
feat:增强对 JDK8 的兼容性
This commit is contained in:
+4
-4
@@ -7,11 +7,11 @@ import cn.iocoder.yudao.module.fms.dal.dataobject.config.FmsAccountUserDO;
|
||||
import cn.iocoder.yudao.module.fms.dal.mysql.config.FmsAccountUserMapper;
|
||||
import cn.iocoder.yudao.module.fms.enums.config.FmsAccountUserLevelEnum;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -36,9 +36,9 @@ public class FmsAccountUserServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private FmsAccountUserMapper accountUserMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private FmsAccountSetService accountSetService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+7
-7
@@ -24,11 +24,11 @@ import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.hrm.service.insurance.config.HrmInsuranceSchemeService;
|
||||
import cn.iocoder.yudao.module.hrm.service.insurance.employee.HrmInsuranceEmployeeInfoService;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -65,15 +65,15 @@ public class HrmInsuranceMonthEmployeeRecordServiceImplTest extends BaseDbUnitTe
|
||||
@Resource
|
||||
private HrmInsuranceMonthEmployeeRecordMapper monthEmployeeRecordMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmInsuranceMonthRecordService monthRecordService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmInsuranceSchemeService insuranceSchemeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmInsuranceEmployeeInfoService insuranceEmployeeInfoService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+7
-7
@@ -42,12 +42,12 @@ import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -103,15 +103,15 @@ public class HrmPerformanceAssessmentProcessServiceImplTest extends BaseDbUnitTe
|
||||
@Resource
|
||||
private HrmPerformancePlanMapper planMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private DeptApi deptApi;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmPerformancePlanService planService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmPerformanceAssessmentActionRecordService assessmentActionRecordService;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+5
-5
@@ -14,12 +14,12 @@ import cn.iocoder.yudao.module.hrm.enums.recruit.candidate.HrmRecruitInterviewRe
|
||||
import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -63,11 +63,11 @@ public class HrmRecruitInterviewServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private HrmRecruitInterviewMapper recruitInterviewMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmRecruitCandidateService recruitCandidateService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+5
-5
@@ -12,11 +12,11 @@ import cn.iocoder.yudao.module.hrm.enums.employee.info.HrmEmployeeEntryStatusEnu
|
||||
import cn.iocoder.yudao.module.hrm.enums.recruit.post.HrmRecruitPostStatusEnum;
|
||||
import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -64,11 +64,11 @@ public class HrmRecruitPostServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private HrmRecruitPostMapper recruitPostMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmRecruitPostTypeService recruitPostTypeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private DeptApi deptApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+5
-5
@@ -12,11 +12,11 @@ import cn.iocoder.yudao.module.hrm.dal.mysql.salary.config.HrmSalaryGroupMapper;
|
||||
import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -52,11 +52,11 @@ public class HrmSalaryGroupServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private HrmSalaryGroupMapper salaryGroupMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmSalaryTaxRuleService salaryTaxRuleService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private DeptApi deptApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+4
-4
@@ -13,11 +13,11 @@ import cn.iocoder.yudao.module.hrm.service.employee.info.HrmEmployeeService;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.hrm.enums.salary.slip.HrmSalarySlipReadStatusEnum;
|
||||
import cn.iocoder.yudao.module.hrm.enums.salary.slip.HrmSalarySlipTemplateOptionTypeEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.annotation.Resource;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.bean.override.mockito.MockitoBean;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.YearMonth;
|
||||
@@ -54,9 +54,9 @@ public class HrmSalarySlipServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private HrmSalarySlipMapper salarySlipMapper;
|
||||
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private HrmEmployeeService employeeService;
|
||||
@MockitoBean
|
||||
@MockBean
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
|
||||
@BeforeEach
|
||||
|
||||
+8
-7
@@ -17,6 +17,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentMatcher;
|
||||
import org.mockito.InjectMocks;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -56,7 +57,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat(assertRequest(config.getAppId(), null, buyerOpenId))))
|
||||
.thenReturn(response);
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_OPEN_ID_KEY, buyerOpenId));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_OPEN_ID_KEY, buyerOpenId));
|
||||
|
||||
PayOrderRespDTO resp = client.unifiedOrder(reqDTO);
|
||||
|
||||
@@ -80,7 +81,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat(assertRequest(config.getAppId(), buyerId, null))))
|
||||
.thenReturn(response);
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_ID_KEY, buyerId));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_ID_KEY, buyerId));
|
||||
|
||||
PayOrderRespDTO resp = client.unifiedOrder(reqDTO);
|
||||
|
||||
@@ -98,7 +99,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat(assertRequest(config.getAppId(), null, buyerOpenId))))
|
||||
.thenReturn(response);
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of("openid", buyerOpenId));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap("openid", buyerOpenId));
|
||||
|
||||
PayOrderRespDTO resp = client.unifiedOrder(reqDTO);
|
||||
|
||||
@@ -117,7 +118,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.certificateExecute(argThat(assertRequest(config.getAppId(), null, buyerOpenId))))
|
||||
.thenReturn(response);
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_OPEN_ID_KEY, buyerOpenId));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_OPEN_ID_KEY, buyerOpenId));
|
||||
|
||||
PayOrderRespDTO resp = client.unifiedOrder(reqDTO);
|
||||
|
||||
@@ -139,7 +140,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat((ArgumentMatcher<AlipayTradeCreateRequest>) request -> true)))
|
||||
.thenReturn(response);
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
|
||||
PayOrderRespDTO resp = client.unifiedOrder(reqDTO);
|
||||
|
||||
@@ -170,7 +171,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat((ArgumentMatcher<AlipayTradeCreateRequest>) request -> true)))
|
||||
.thenThrow(ServiceExceptionUtil.exception(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR));
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
|
||||
assertThrows(ServiceException.class, () -> client.unifiedOrder(reqDTO));
|
||||
}
|
||||
@@ -181,7 +182,7 @@ public class AlipayLitePayClientTest extends AbstractAlipayClientTest {
|
||||
when(defaultAlipayClient.execute(argThat((ArgumentMatcher<AlipayTradeCreateRequest>) request -> true)))
|
||||
.thenThrow(new RuntimeException("系统异常"));
|
||||
PayOrderUnifiedReqDTO reqDTO = buildOrderUnifiedReqDTO(randomURL(), randomString(), randomInteger());
|
||||
reqDTO.setChannelExtras(Map.of(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
reqDTO.setChannelExtras(Collections.singletonMap(AlipayLitePayClient.BUYER_OPEN_ID_KEY, randomString()));
|
||||
|
||||
assertThrows(PayClientException.class, () -> client.unifiedOrder(reqDTO));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user